Created
July 28, 2016 09:38
-
-
Save yukas/40dd1f7212d068b40961041f4b2083c4 to your computer and use it in GitHub Desktop.
Testing service object
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 UserCreator do | |
describe "#create_user" do | |
it "creates user" do | |
user_creator = UserCreator.new("ian@brown.com", "Ian", "Brown") | |
user_creator.create_user | |
expect(user_creator.created_user.email).to eq("ian@brown.com") | |
expect(user_creator.created_user.first_name).to eq("Ian") | |
expect(user_creator.created_user.last_name).to eq("Brown") | |
end | |
context "no email given" do | |
it "raises exception" do | |
expect { | |
UserCreator.new(nil, "Ian", "Brown") | |
}.to raise_error(/Missing email/) | |
end | |
end | |
context "user already exists" do | |
... | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment