spec/hallon/user_spec.rb in hallon-0.13.0 vs spec/hallon/user_spec.rb in hallon-0.14.0
- old
+ new
@@ -1,7 +1,9 @@
# coding: utf-8
describe Hallon::User do
+ it { described_class.should include Hallon::Loadable }
+
it_should_behave_like "a Linkable object" do
let(:spotify_uri) { "spotify:user:burgestrand" }
let(:custom_object) { "burgestrand" }
end
@@ -28,26 +30,20 @@
describe "#post" do
let(:post) { mock_session { user.post(tracks) } }
let(:tracks) { instantiate(Hallon::Track, mock_track, mock_track_two) }
- it "should have an error status" do
- post.status.should eq :ok
- end
-
it "should post to the correct user" do
- Spotify.should_receive(:inbox_post_tracks).with(any_args, user.name, any_args, any_args, any_args, any_args, any_args).and_return(null_pointer)
- mock_session { user.post(tracks) }
+ post.recipient_name.should eq user.name
end
- it "should use given message if available" do
- Spotify.should_receive(:inbox_post_tracks).with(any_args, any_args, any_args, any_args, "Hello there", any_args, any_args).and_return(null_pointer)
- mock_session { user.post("Hello there", tracks) }
+ it "should post with the given message" do
+ post.message.should be_nil
+ stub_session { user.post("Hey ho!", tracks) }.message.should eq "Hey ho!"
end
it "should return nil on failure" do
- Spotify.should_receive(:inbox_post_tracks).and_return(null_pointer)
- mock_session { user.post([]).should be_nil }
+ stub_session { user.post([]).should be_nil }
end
end
describe "#starred" do
let(:starred) { Hallon::Playlist.new("spotify:user:%s:starred" % user.name) }