I can’t figure out why I am getting a failure. It renders out fine in
the browser.
New member
<%= error_messages_for :member %>
<% form_for(:member, :url => members_path) do |f| %>
Member InfoFirst Name: <%= f.text_field :first_name %>
Last Name: <%= f.text_field :last_name %>
<%= submit_tag "Create" %>
<% end %> <%= link_to 'Back', members_path %>ActionView::TemplateError in ‘/members/new.rhtml should render new form’
Mock ‘Member_1002’ received unexpected message :first_name with (no
args)
On line #9 of app/views/members/new.rhtml
6:
7: <fieldset>
8: <legend>Member Info</legend>
9: <p><label for="member[first_name]">First Name:</label> <%=
f.text_field :first_name %>
10:
Last Name: <%=
f.text_field :last_name %>
11:
12:
#{RAILS_ROOT}/vendor/plugins/rspec/lib/spec/mocks/error_generator.rb:52:in
__raise' #{RAILS_ROOT}/vendor/plugins/rspec/lib/spec/mocks/error_generator.rb:16:in
raise_unexpected_message_error’
#{RAILS_ROOT}/vendor/plugins/rspec/lib/spec/mocks/proxy.rb:83:in
raise_unexpected_message_error' #{RAILS_ROOT}/vendor/plugins/rspec/lib/spec/mocks/mock.rb:20:in
method_missing’
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/helpers/form_helper.rb:356:in
send' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/helpers/form_helper.rb:356:in
value_before_type_cast’
This is using the auto-created test
it “should render new form” do
render “/members/new.rhtml”
response.should have_tag("form[action=?][method=post]",
members_path) do
end
end
Thanks for the help