Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
j_platform / spec / models / social_message_spec.rb
Size: Mime:
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