[rspec-users] Problems with redirect_to
dchelimsky at gmail.com
Fri Feb 22 09:00:32 EST 2008
On Fri, Feb 22, 2008 at 7:50 AM, Maurício Linhares
<mauricio.linhares at gmail.com> wrote:
> Hello guys,
> I have the following spec:
> describe 'With successful save' do
> it 'Should redirect to the new page' do
> response.should be_redirect
> response.should redirect_to( :action => 'show', :id =>
> @static_page.permalink ) ## this is the line 118
> And when I try to run it it gives me the following error:
> ActionController::MethodNotAllowed in 'StaticPagesController Handling
> POST /pages With successful save Should redirect to the new page'
> Only get, put, and delete requests are allowed.
> So, the response is a redirect (the "response.should be_redirect"
> passes) but when i try to be sure that it redirected to the right page
> it throws this weird error to me. Any ideas about what I've done
Can you post the full backtrace?
script/spec ./spec/controllers/static_pages_controller_spec.rb -b
> I'm using RSpec 1.1.3 and Rails 2.0.2.
> Maurício Linhares
> http://alinhavado.wordpress.com/ (pt-br) |
> http://codeshooter.wordpress.com/ (en)
> João Pessoa, PB, +55 83 8867-7208
> rspec-users mailing list
> rspec-users at rubyforge.org
More information about the rspec-users