Hello i have a problem with Rspec + Capybara. I wanna to test that my ajax comments can be post. My error is because a post doesn't create.
Failure/Error: page.should have_content('Could')
When i output @post i see
#<Post id: 1, title: "Deploying through ssh", body: "This is post about ssh", slug: deploying-through-ssh, published: nil, published_at: nil, created_at: "2013-02-05 17:37:39", updated_at: "2013-02-05 17:37:39", user_id: nil, meta_desc: nil>
describe "Sending Comments" do
before(:each) do
@post = FactoryGirl.create(:post)
end
it "should allow user to post new comment", :js => true do
visit post_path(@post)
page.should have_content('Could')
fill_in 'comment[name]', :with => "name"
fill_in 'comment_email', :with => "email@mail.com"
fill_in 'comment_content', :with => "content"
end
end