Skip to content

Instantly share code, notes, and snippets.

@markfeedly
Created October 9, 2013 11:11
Show Gist options
  • Save markfeedly/6899625 to your computer and use it in GitHub Desktop.
Save markfeedly/6899625 to your computer and use it in GitHub Desktop.
I can only conclude that the subject is out of scope
Failures:
1) Micropost should not be valid when user_id is not present
Failure/Error: it { should_not be_valid }
expected #<Micropost id: 1, content: "lorem ipsum", user_id: 1, created_at: "2013-10-09 11:10:10", updated_at: "2013-10-09 11:10:10"> not to be valid
-------------------
describe Micropost do
before(:each) {DatabaseCleaner.clean}
let(:user) { FactoryGirl.create(:user) }
subject { FactoryGirl.create(:micropost, user_id: user.id) }
it { should respond_to(:content) }
it { should respond_to(:user_id) }
describe "should not be valid when user_id is not present" do
user_id = nil
it { should_not be_valid }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment