Sha256: 3589ba9dd805c3694b1de46ba700bcc54d52d7ed7f06eb91cbc2ed8aab00720f

Contents?: true

Size: 869 Bytes

Versions: 20

Compression:

Stored size: 869 Bytes

Contents

require 'spec_helper'

describe Alchemy::Admin::ContentsController do

	before(:each) do
		activate_authlogic
		Alchemy::UserSession.create Factory(:admin_user)
	end

	it "should update a content via ajax" do
		@element = Factory(:element)
		post :update, {:id => @element.contents.find_by_name('intro').id, :content => {:body => 'Peters Petshop'}, :format => :js}
		@element.ingredient('intro').should == "Peters Petshop"
	end

	describe "#order" do

		context "with content_ids in params" do

			before(:each) do
				@element = Factory(:element)
			end

			it "should reorder the contents" do
				content_ids = @element.contents.essence_texts.collect(&:id)
				post :order, {:content_ids => content_ids.reverse, :format => :js}
				response.status.should == 200
				@element.contents.essence_texts.collect(&:id).should == content_ids.reverse
			end

		end

	end

end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
alchemy_cms-2.1.12 spec/controllers/admin/contents_controller_spec.rb
alchemy_cms-2.1.11 spec/controllers/admin/contents_controller_spec.rb
alchemy_cms-2.1.9.1 spec/controllers/admin/contents_controller_spec.rb
alchemy_cms-2.1.9 spec/controllers/admin/contents_controller_spec.rb
alchemy_cms-2.1.8.1 spec/controllers/admin/contents_controller_spec.rb
alchemy_cms-2.1.8 spec/controllers/admin/contents_controller_spec.rb
alchemy_cms-2.1.7 spec/controllers/admin/contents_controller_spec.rb
alchemy_cms-2.1.6 spec/controllers/admin/contents_controller_spec.rb
alchemy_cms-2.1.5 spec/controllers/admin/contents_controller_spec.rb
alchemy_cms-2.1.4 spec/controllers/admin/contents_controller_spec.rb
alchemy_cms-2.1.3 spec/controllers/admin/contents_controller_spec.rb
alchemy_cms-2.1.2 spec/controllers/admin/contents_controller_spec.rb
alchemy_cms-2.1.1 spec/controllers/admin/contents_controller_spec.rb
alchemy_cms-2.1 spec/controllers/admin/contents_controller_spec.rb
alchemy_cms-2.1.rc6 spec/controllers/admin/contents_controller_spec.rb
alchemy_cms-2.1.rc5 spec/controllers/admin/contents_controller_spec.rb
alchemy_cms-2.1.rc4 spec/controllers/admin/contents_controller_spec.rb
alchemy_cms-2.1.rc3 spec/controllers/admin/contents_controller_spec.rb
alchemy_cms-2.1.rc2 spec/controllers/admin/contents_controller_spec.rb
alchemy_cms-2.1.beta6 spec/controllers/admin/contents_controller_spec.rb