spec/shelly/cli_spec.rb in shelly-0.0.2 vs spec/shelly/cli_spec.rb in shelly-0.0.3
- old
+ new
@@ -66,20 +66,20 @@
end
end.should raise_error(SystemExit)
end
context "on successful registration" do
- it "should notify user about email verification" do
+ it "should display message about registration and email confirmation" do
@client.stub(:register_user).and_return(true)
- $stdout.should_receive(:puts).with("Check you mailbox for email confirmation")
+ $stdout.should_receive(:puts).with("Successfully registered!\nCheck you mailbox for email confirmation")
fake_stdin(["kate@example.com", "pass"]) do
@cli.register
end
end
end
context "on unsuccessful registration" do
- it "should notify user about errors" do
+ it "should display errors" do
response = {"message" => "Validation Failed", "errors" => [["email", "has been already taken"]]}
exception = Shelly::Client::APIError.new(response)
@client.stub(:register_user).and_raise(exception)
$stdout.should_receive(:puts).with("email has been already taken")
fake_stdin(["kate@example.com", "pass"]) do