diff --git a/Gemfile b/Gemfile index 8ed02f2b..1b552916 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,4 @@ -sou rce :rubygems +source :rubygems # add in all the runtime dependencies diff --git a/Gemfile.lock b/Gemfile.lock index d2cab1b3..8dce1607 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -94,7 +94,7 @@ GEM delayed_job_mongoid (1.0.0.rc) delayed_job (~> 2.1) mongoid (~> 2.0) - devise (1.1.2) + devise (1.1.3) bcrypt-ruby (~> 2.1.2) warden (~> 0.10.7) diff-lcs (1.1.2) @@ -236,7 +236,7 @@ DEPENDENCIES database_cleaner delayed_job (= 2.1.0.pre2) delayed_job_mongoid (= 1.0.0.rc) - devise (= 1.1.2) + devise (= 1.1.3) factory_girl_rails fastthread formtastic (>= 1.1.0) diff --git a/app/helpers/admin/pages_helper.rb b/app/helpers/admin/pages_helper.rb index e1b5f6ae..65fcd88a 100644 --- a/app/helpers/admin/pages_helper.rb +++ b/app/helpers/admin/pages_helper.rb @@ -20,7 +20,7 @@ module Admin::PagesHelper def parent_pages_options roots = current_site.pages.roots.where(:slug.ne => '404').and(:_id.ne => @page.id) - returning [] do |list| + [].tap do |list| roots.each do |page| list = add_children_to_options(page, list) end diff --git a/app/uploaders/theme_asset_uploader.rb b/app/uploaders/theme_asset_uploader.rb index 37ae68db..d332e1d5 100644 --- a/app/uploaders/theme_asset_uploader.rb +++ b/app/uploaders/theme_asset_uploader.rb @@ -7,7 +7,7 @@ class ThemeAssetUploader < AssetUploader process :set_width_and_height def store_dir - File.join('sites', model.site_id.to_s, 'theme', model.folder_was || model.folder) + File.join('sites', (model.site_id_was || model.site_id).to_s, 'theme', model.folder_was || model.folder) end def stale_model? diff --git a/app/views/admin/imports/show.html.haml b/app/views/admin/imports/show.html.haml index 016278ee..a7a76f67 100644 --- a/app/views/admin/imports/show.html.haml +++ b/app/views/admin/imports/show.html.haml @@ -8,7 +8,7 @@ %p!= t('.help') -%ul{ :id => 'import-steps', :class => 'list', :'data-url' => admin_import_url(:json), :'data-success-message' => t('.message.success'), :'data-failure-message' => t('.message.failure') } +%ul{ :id => 'import-steps', :class => 'list', :'data-url' => admin_import_url(:json), :'data-success-message' => t('.messages.success'), :'data-failure-message' => t('.messages.failure') } - %w(site content_types assets asset_collections snippets pages).each do |step| %li{ :id => "#{step}-step" } %em diff --git a/config/locales/admin_ui_en.yml b/config/locales/admin_ui_en.yml index 86278234..6ecbbac3 100644 --- a/config/locales/admin_ui_en.yml +++ b/config/locales/admin_ui_en.yml @@ -287,8 +287,6 @@ en: attributes: Attributes upload: Upload labels: - page: - raw_template: Template theme_asset: new: source: File diff --git a/features/admin/pages.feature b/features/admin/pages.feature index 2854d2d7..3dd941bd 100644 --- a/features/admin/pages.feature +++ b/features/admin/pages.feature @@ -18,7 +18,7 @@ Scenario: Creating a valid page And I fill in "Title" with "Test" And I fill in "Slug" with "test" And I select "Home page" from "Parent" - And I fill in "Template" with "Lorem ipsum...." + And I fill in "Raw template" with "Lorem ipsum...." And I press "Create" Then I should see "Page was successfully created." And I should have "Lorem ipsum...." in the test page @@ -27,7 +27,7 @@ Scenario: Updating a valid page When I go to pages And I follow "Home page" And I fill in "Title" with "Home page !" - And I fill in "Template" with "My new content is here" + And I fill in "Raw template" with "My new content is here" And I press "Update" Then I should see "Page was successfully updated." And I should have "My new content is here" in the index page diff --git a/spec/models/page_spec.rb b/spec/models/page_spec.rb index c0cb46e3..ba899019 100644 --- a/spec/models/page_spec.rb +++ b/spec/models/page_spec.rb @@ -120,8 +120,9 @@ describe Page do it 'should add sub pages' do child_2 = Factory(:page, :title => 'Subpage 2', :slug => 'bar', :parent => @home, :site => @home.site) - Page.first.children.count.should == 2 - Page.first.children.should == [@child_1, child_2] + @home = Page.find(@home.id) + @home.children.count.should == 2 + @home.children.should == [@child_1, child_2] end it 'should move its children accordingly' do