Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: df31ef04cc
Fetching contributors…

Cannot retrieve contributors at this time

33 lines (25 sloc) 0.795 kb
require 'spec_helper'
describe Relationship do
let(:follower) { FactoryGirl.create(:user) }
let(:followed) { FactoryGirl.create(:user) }
let(:relationship) do
follower.relationships.build(followed_id: followed.id)
end
subject { relationship }
it { should be_valid }
describe "follower methods" do
before { relationship.save }
it { should respond_to(:follower) }
it { should respond_to(:followed) }
its(:follower) { should == follower }
its(:followed) { should == 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
Jump to Line
Something went wrong with that request. Please try again.