Created
June 11, 2011 23:28
-
-
Save caironoleto/1021081 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<%= form_for(@post) do |f| %> | |
<% end %> |
This file contains hidden or 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
Running: spec/views/posts/new.html.erb_spec.rb | |
posts/new.html.erb | |
renders new post form (FAILED - 1) | |
Failures: | |
1) posts/new.html.erb renders new post form | |
Failure/Error: assert_select "input#post_title", name: 'post[title]' | |
MiniTest::Assertion: | |
Expected at least 1 element matching "input#post_title", found 0. | |
# (eval):2:in `assert' | |
# ./spec/views/posts/new.html.erb_spec.rb:15:in `block (3 levels) in <top (required)>' | |
# ./spec/views/posts/new.html.erb_spec.rb:14:in `block (2 levels) in <top (required)>' | |
Finished in 0.36057 seconds | |
1 example, 1 failure | |
Failed examples: | |
rspec ./spec/views/posts/new.html.erb_spec.rb:8 # posts/new.html.erb renders new post form |
This file contains hidden or 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
require File.expand_path('spec/spec_helper') | |
describe "posts/new.html.erb" do | |
before(:each) do | |
assign(:post, stub_model(Post).as_new_record) | |
end | |
it "renders new post form" do | |
render | |
assert_select "form", action: posts_path, method: 'post' do | |
assert_select "input#post_title", name: 'post[title]' | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment