Permalink
Browse files

Fix pages specs for new id in edit link

  • Loading branch information...
1 parent a941cf1 commit e43fb8bbb59c4188c81de975e202e4265e21a42d @joemsak joemsak committed May 24, 2012
Showing with 5 additions and 5 deletions.
  1. +5 −5 pages/spec/requests/refinery/admin/pages_spec.rb
@@ -128,7 +128,7 @@ module Admin
page.body.should =~ /Remove this page forever/
page.body.should =~ /Edit this page/
- page.body.should =~ %r{/refinery/pages/my-first-page/edit}
+ page.body.should =~ %r{/refinery/pages/#{Page.last.id}/edit}
page.body.should =~ /Add a new child page/
page.body.should =~ %r{/refinery/pages/new\?parent_id=}
page.body.should =~ /View this page live/
@@ -302,11 +302,11 @@ module Admin
end
end
- it "shows title in the admin menu" do
+ it "uses the id for the edit link" do
p = ::Refinery::Page.by_slug('news').first
within "#page_#{p.id}" do
page.should have_content('News')
- page.find_link('Edit this page')[:href].should include('news')
+ page.find_link('Edit this page')[:href].should include(p.id.to_s)
end
end
@@ -390,11 +390,11 @@ module Admin
end
end
- it "uses the slug from the default locale in admin" do
+ it "uses the id of the page for the edit link" do
visit refinery.admin_pages_path
within "#page_#{news_page.id}" do
- page.find_link('Edit this page')[:href].should include(en_page_slug)
+ page.find_link('Edit this page')[:href].should include(news_page.id.to_s)
end
end

0 comments on commit e43fb8b

Please sign in to comment.