Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
luciajanikova committed Nov 16, 2024
1 parent f2efb2b commit 7e94555
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions test/models/fs/box_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# frozen_string_literal: true

require "test_helper"

class Fs::BoxTest < ActiveSupport::TestCase
test "#after_create callback sets syncable value to true if tenant fs_sync feature is enabled" do
tenant = tenants(:accountants)
tenant.enable_feature(:fs_sync)

box = tenant.boxes.create(
name: 'Test box',
short_name: 'FS TB',
uri: 'dic://sk/0246802',
type: 'Fs::Box'
)

assert box.reload.syncable
end

test "#after_create callback sets syncable value to false if tenant fs_sync feature is disabled" do
tenant = tenants(:ssd)
tenant.disable_feature(:fs_sync)

box = tenant.boxes.create(
name: 'Test box',
short_name: 'FS TB',
uri: 'dic://sk/0246802',
type: 'Fs::Box'
)

assert_not box.reload.syncable
end
end

0 comments on commit 7e94555

Please sign in to comment.