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