Created
February 26, 2015 13:46
-
-
Save Griminy/8143c7984090fe1a2893 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
require 'test_helper' | |
module MagazCore | |
class ShopServices::CreateInviteTest < ActiveSupport::TestCase | |
include Rails.application.routes.url_helpers | |
setup do | |
@shop = create(:shop, name: 'shop_name') | |
@host = shop_name.magaz.local:3000 | |
@email = '[email protected]' | |
end | |
test 'create user with token and email' do | |
service = MagazCore::ShopServices::CreateInvite | |
.call(shop: @shop, email: @email, host: @host) | |
assert service.user.persisted? | |
assert_equal @shop.id, service.user.shop_id | |
assert_not service.user.invite_token.blank? | |
assert_equal @email, service.user.email | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment