spec/hallon/user_post_spec.rb in hallon-0.15.0 vs spec/hallon/user_post_spec.rb in hallon-0.16.0
- old
+ new
@@ -1,20 +1,20 @@
# coding: utf-8
describe Hallon::User::Post do
- it { described_class.should include Hallon::Loadable }
+ let(:post) do
+ Hallon::User::Post.create("burgestrand", "These be some tight tracks, yo!", tracks)
+ end
let(:tracks) do
[].tap do |tracks|
tracks << Hallon::Track.new(mock_track)
tracks << Hallon::Track.new(mock_track_two)
end
end
- let(:post) do
- stub_session { Hallon::User::Post.create("burgestrand", "These be some tight tracks, yo!", tracks) }
- end
+ specify { post.should be_a Hallon::Loadable }
describe ".new" do
it "should be private" do
Hallon::User::Post.should_not respond_to :new
end
@@ -25,11 +25,11 @@
Spotify.should_receive(:inbox_post_tracks).and_return(null_pointer)
post.should be_nil
end
it "should allow you to post a single track" do
- post = stub_session { Hallon::User::Post.create("burgestrand", nil, tracks[0]) }
+ post = Hallon::User::Post.create("burgestrand", nil, tracks[0])
post.tracks.should eq tracks[0, 1]
end
end
describe "#status" do
@@ -56,9 +56,14 @@
end
describe "#message" do
it "should return the message sent with the post" do
post.message.should eq "These be some tight tracks, yo!"
+ end
+
+ it "returns an empty string if no message was sent" do
+ post = Hallon::User::Post.create("burgestrand", nil, tracks)
+ post.message.should be_nil
end
end
describe "#recipient" do
it "should return the recipient" do