spec/client_spec.rb in chatterbot-0.6.2 vs spec/client_spec.rb in chatterbot-0.6.3

- old
+ new

@@ -85,6 +85,24 @@ it "handles errors" do @bot.should_receive(:display_oauth_error) @bot.login end end + + describe "get_screen_name" do + before(:each) do + @json = '{"id":12345,"screen_name":"mockbot"}' + + @token = mock(Object) + response = mock(Object, :body => @json) + @token.should_receive(:get).with("/1/account/verify_credentials.json").and_return(response) + end + + it "should work" do + @bot.get_screen_name(@token) + @bot.screen_name.should == "mockbot" + end + end + + + end