Repository URL to install this package:
Version:
2.23.0 ▾
|
require 'spec_helper'
describe SocialMessage, :type => :model do
subject { SocialMessage.find(1) }
before(:each) do
stub_get("/api/v1/social_messages/1.json").to_return(body: fixture("social_message.json"), headers: {content_type: "application/json; charset=utf-8"})
end
describe "network" do
it "returns the corresponding social network of the message" do
expect(subject.network).to eq("twitter")
end
end
describe "network_message? creates helper methods to quickly check if a message is from certain network" do
context "when social message is from twitter" do
it "returns true on twitter_message?" do
expect(subject.twitter_message?).to be_truthy
end
it "return false on facebook_message?" do
expect(subject.facebook_message?).to be_falsey
end
end
end
end