Permalink
Browse files

Closes GH-1461

  • Loading branch information...
1 parent 6ade9bb commit 079a2e6b6736e8508762999d786bb98461344961 René Groß committed Apr 3, 2012
@@ -1,5 +1,5 @@
<%= form_for [refinery, :admin, @page],
- :url => (refinery.admin_page_path(@page.uncached_nested_url) if @page.persisted?) do |f| %>
+ :url => (refinery.admin_page_path(@page) if @page.persisted?) do |f| %>
<%= render '/refinery/admin/error_messages', :object => @page, :include_object_name => true %>
@@ -31,11 +31,11 @@
:title => t('new', :scope => 'refinery.admin.pages') %>
<%= link_to refinery_icon_tag('application_edit.png'),
- refinery.edit_admin_page_path(page.uncached_nested_url),
+ refinery.edit_admin_page_path(page),
:title => t('edit', :scope => 'refinery.admin.pages') %>
<%= link_to refinery_icon_tag('delete.png'),
- refinery.admin_page_path(page.uncached_nested_url),
+ refinery.admin_page_path(page),
:class => "cancel confirm-delete",
:title => t('delete', :scope => 'refinery.admin.pages'),
:confirm => t('message', :scope => 'refinery.admin.delete', :title => page.title_with_meta.gsub(/\ ?<em>.*<\/em>/, "")),
@@ -488,6 +488,52 @@ module Admin
end
end
end
+
+ describe "add a translation for a child page" do
+ let(:de_page_title) { 'Über uns' }
+ let(:de_page_slug) { 'uber-uns' }
+ let(:de_page_title_2) { 'Mitarbeiter' }
+ let(:de_page_slug_2) { 'mitarbeiter' }
+ let(:en_page_title) { 'Team' }
+ let(:about_us_page) { FactoryGirl.create(:page, :title => de_page_title) }
+ let!(:team_page) do
+ Refinery::I18n.stub(:frontend_locales).and_return([:de, :en])
+ Refinery::I18n.stub(:default_frontend_locale).and_return(:de)
+
+ _page = Globalize.with_locale(:de) {
+ FactoryGirl.create(:page, :title => de_page_title_2, :parent => about_us_page)
+ }
+ Globalize.with_locale(:en) do
+ _page.title = en_page_title
+ _page.save
+ end
+
+ _page
+ end
+
+ it "succeeds" do
+ team_page.destroy!
+ visit refinery.admin_pages_path
+
+ within "#page_#{about_us_page.id}" do
+ click_link "Page_add"
+ end
+ fill_in "Title", :with => de_page_title_2
+ click_button "Save"
+
+ within "#page_#{Page.last.id}" do
+ click_link "Application_edit"
+ end
+ within "#switch_locale_picker" do
+ click_link "En"
+ end
+ fill_in "Title", :with => en_page_title
+ click_button "Save"
+
+ page.should have_content("'#{en_page_title}' was successfully updated.")
+ Refinery::Page.count.should == 3
+ end
+ end
end
describe "new page part", :js => true do

0 comments on commit 079a2e6

Please sign in to comment.