[rspec-devel] [ rspec-Bugs-7795 ] form_tag renders action=" /view_spec" in view specs
noreply at rubyforge.org
noreply at rubyforge.org
Tue Apr 3 00:02:39 EDT 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: Closed
>Resolution: Accepted
Priority: 3
Submitted By: David Chelimsky (dchelimsky)
>Assigned to: David Chelimsky (dchelimsky)
>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>
----------------------------------------------------------------------
>Comment By: David Chelimsky (dchelimsky)
Date: 2007-04-03 04:02
Message:
Fixed in branches/0.9-dev (rev 1679)
----------------------------------------------------------------------
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