Sha256: 6a473318aa54ea83dfb2218c3164a534935980959d2e8459bb7bca35cff2eb80
Contents?: true
Size: 954 Bytes
Versions: 4
Compression:
Stored size: 954 Bytes
Contents
require 'spec_helper' describe Alchemy::Admin::ContentsController do before(:each) do activate_authlogic Alchemy::UserSession.create FactoryGirl.create(:admin_user) end it "should update a content via ajax" do @element = FactoryGirl.create(: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 = FactoryGirl.create(: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
4 entries across 4 versions & 1 rubygems