3

i upgraded my RefineryCMS based application recently from Rails 3.2.2 to 3.2.6.

Prior to the upgrade the follwoing spec for the pages controller of refinery worked out pretty well:

describe Refinery::PagesController do
render_views

context "Should check the ability to see a page" do
  before(:each) do 
    @live_page = FactoryGirl.create(:live_refinery_page)
    @restricted_page = FactoryGirl.create(:restricted_refinery_page) 
    @draft_page = FactoryGirl.create(:draft_refinery_page)
    @error_page = FactoryGirl.create(:error_refinery_page)
  end

context "for a not logged in user" do
  it "should see live pages" do
    get :show, :path => @live_page.slug, :format => "html"
    response.should be_success
    response.should render_template "refinery/pages/show"
  end
  ...

The route that should be matched is defined as follows:

marketable_page GET     /*path(.:format)                             refinery/pages#show

Now, the problem ist that i am getting an error like this for all the tests:

1) Refinery::PagesController Should check the ability to see a page for a not logged in user should see live pages
 Failure/Error: get :show, :path => @live_page.slug, :format => "html"
 ActionController::RoutingError:
   No route matches {:path=>"live-page-1", :format=>"html", :controller=>"refinery/pages", :action=>"show"}
 # ./config/initializers/refinery/monkey_patches.rb:13:in `around_generate'
 # ./spec/controllers/refinery/pages_controller_spec.rb:17:in `block (4 levels) in <top (required)>

How can i make the route to be recognized in the specs ? Maybe it has to do somethin with route globbing ?

Any hints ?

MyP
  • 51
  • 4
  • i managed to at leat let the spec pass by defining my own routes as discribed here: http://stackoverflow.com/questions/5200654/how-do-i-write-a-rails-3-1-engine-controller-test-in-rspec But that does not seem to be a good solution... ?! – MyP Jul 01 '12 at 21:34

0 Answers0