Lots of fixes to get tets closer to working.

This commit is contained in:
Mario Visic 2011-11-20 21:59:12 +11:00
parent a97978468f
commit a7b66f0e25
17 changed files with 18 additions and 21 deletions

View File

@ -1,18 +1,17 @@
module Locomotive
class CurrentSiteController < BaseController
defaults :instance_name => 'site'
sections 'settings', 'site'
actions :edit, :update
skip_load_and_authorize_resource
load_and_authorize_resource :class => 'Site'
respond_to :json, :only => :update
def edit
end
def update
update! do |success, failure|
success.html { redirect_to edit_current_site_url(new_host_if_subdomain_changed) }

View File

@ -3,8 +3,6 @@ module Locomotive
sections 'settings', 'site'
actions :show, :new, :create
skip_load_and_authorize_resource
before_filter :authorize_import
@ -23,7 +21,8 @@ module Locomotive
end
end
def new; end
def new
end
def create
begin
@ -52,4 +51,4 @@ module Locomotive
end
end
end
end

View File

@ -3,12 +3,13 @@ module Locomotive
sections 'settings', 'account'
actions :edit, :update
respond_to :json, :only => :update
skip_load_and_authorize_resource
def edit
end
def update
update! { edit_my_account_url }
end

View File

@ -1,8 +1,6 @@
module Locomotive
class SitesController < BaseController
defaults :instance_name => 'site'
sections 'settings'
def create

View File

@ -124,4 +124,4 @@ module Locomotive
end
end
end
end

View File

@ -144,4 +144,4 @@ module Locomotive
end
end
end
end

View File

@ -1,6 +1,6 @@
require 'spec_helper'
describe Ability do
describe Locomotive::Ability do
before :each do
@site = FactoryGirl.create(:site)
@ -13,7 +13,7 @@ describe Ability do
context 'pages' do
subject { Page.new }
subject { Locomotive::Page.new }
context 'management' do
it 'should allow management of pages from (admin, designer, author)' do
@ -33,7 +33,7 @@ describe Ability do
context 'content instance' do
subject { ContentInstance.new }
subject { Locomotive::ContentInstance.new }
context 'management' do
it 'should allow management of pages from (admin, designer, author)' do
@ -47,7 +47,7 @@ describe Ability do
context 'content type' do
subject { ContentType.new }
subject { Locomotive::ContentType.new }
context 'management' do
it 'should allow management of pages from (admin, designer)' do
@ -67,7 +67,7 @@ describe Ability do
context 'theme assets' do
subject { ThemeAsset.new }
subject { Locomotive::ThemeAsset.new }
context 'management' do
it 'should allow management of pages from (admin, designer)' do
@ -87,7 +87,7 @@ describe Ability do
context 'site' do
subject { Site.new }
subject { Locomotive::Site.new }
context 'management' do
it 'should allow management of pages from (admin)' do
@ -115,7 +115,7 @@ describe Ability do
context 'membership' do
subject { Membership.new }
subject { Locomotive::Membership.new }
context 'management' do
it 'should allow management of memberships from (admin, designer)' do