[rspec-devel] [ rspec-Bugs-7795 ] form_tag renders action="/view_spec" in view specs

noreply at rubyforge.org noreply at rubyforge.org
Sat Jan 13 08:37:02 EST 2007


Bugs item #7795, was opened at 2007-01-13 13:37
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=7795&group_id=797

Category: rails plugin
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: David Chelimsky (dchelimsky)
Assigned to: Nobody (None)
Summary: form_tag renders action="/view_spec" in view specs

Initial Comment:
Given the following view spec:

context "login/login" do
  setup do
    render 'login/login'
  end
  
  specify "should display login form" do
    response.should_have_tag 'form', :attributes => {:action => '/login/login'}
    ...
  end
end


And the following code in /login/login.rhtml:

<% form_tag do %>
...
<% end %>

The spec fails as follows:

'login/login should display login form' FAILED


<form action="/view_spec" method="post">
....
</form>

Apparently, because 'spec/rails' uses a ViewSpecController to render views, form_tag is using that.

Note that this ends up rendering the correct thing when running the app:

<form action="/login/login" method="post">
...
</form>

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=7795&group_id=797


More information about the rspec-devel mailing list