Created
January 27, 2013 10:02
-
-
Save antillas21/4647648 to your computer and use it in GitHub Desktop.
Rspec Post spec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# spec/models/post_spec.rb | |
require 'spec_helper' | |
describe Post do | |
let(:post) { Post.new } | |
describe 'basic attributes' do | |
it 'needs a title, content and name' do | |
post.title = 'post title' | |
post.name = 'post name' | |
post.content = 'post content' | |
post.save.should be_true | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thank you for your help!! i'm creating the structure of the folder so now i have:
spec/models/tag_rspec.rb
spec/models/post_rspec.rb
spec/models/comment_rspec.rb
but i've another dude....can i control the relationship between models? for example: if i want to control that a comment only have a post associated.....