Created
January 18, 2017 20:47
-
-
Save efigarolam/2d5d8e2b5f65280ea4bb26b55acc5732 to your computer and use it in GitHub Desktop.
passing specs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe '#managed_gift_card_systems' do | |
let!(:user) { create(:merchant_user) } | |
let!(:merchantless_gcs) { create(:gift_card_system) } | |
let!(:accountless_gcs) { create(:gift_card_system_with_merchant) } | |
before do | |
accountless_merchant = accountless_gcs.merchants.first | |
accountless_merchant.ledger_entity = nil | |
accountless_merchant.save(validate: false) | |
accountless_gcs.merchants = [accountless_merchant] | |
user.user_subject_permissions << create(:user_subject_permission, user: user, subject: merchantless_gcs, permission: permission(:manage_specific_merchant_system)) | |
user.user_subject_permissions << create(:user_subject_permission, user: user, subject: accountless_gcs, permission: permission(:manage_specific_merchant_system)) | |
end | |
it 'return live systems only' do | |
expect(user.user_subject_permissions.size).to eq 3 | |
expect(user.managed_gift_card_systems.size).to eq 1 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment