Sha256: c26f8c91bbc4d1eedf6a9647a77a3ef55cb12b142b6d8409827407f02bbae580
Contents?: true
Size: 748 Bytes
Versions: 10
Compression:
Stored size: 748 Bytes
Contents
require 'spec_helper' describe Relationship do let(:follower) { FactoryGirl.create(:user) } let(:followed) { FactoryGirl.create(:user) } let(:relationship) { follower.relationships.build(followed_id: followed.id) } subject { relationship } it { should be_valid } describe "follower methods" do it { should respond_to(:follower) } it { should respond_to(:followed) } its(:follower) { should eq follower } its(:followed) { should eq followed } end describe "when followed id is not present" do before { relationship.followed_id = nil } it { should_not be_valid } end describe "when follower id is not present" do before { relationship.follower_id = nil } it { should_not be_valid } end end
Version data entries
10 entries across 10 versions & 1 rubygems