Sha256: 43808fdf69e474fe6546760eac6e96f5c3b6269a39b3e17b7f6600a9386bea73

Contents?: true

Size: 1.05 KB

Versions: 34

Compression:

Stored size: 1.05 KB

Contents

require File.dirname(__FILE__) + "/../../spec_helper"

describe Admin::MessagesController do
  dataset :readers
  
  it "should be a ResourceController" do
    controller.should be_kind_of(Admin::ResourceController)
  end

  it "should handle Messages" do
    controller.class.model_class.should == Message
  end

  describe "on preview" do
    before do
      login_as :existing
    end
    
    it "should render a bare message" do
      get :preview, :id => message_id(:taggy)
      response.should be_success
      response.should render_template('preview')
      response.layout.should == nil
    end

  end
  
  describe "on deliver" do
    before do
      login_as :existing
    end
    
    it "should trigger a sending" do
      message = messages(:taggy)
      Message.should_receive(:find).at_least(:once).and_return(message)
      message.should_receive(:deliver).once
      get :deliver, :id => message_id(:taggy), :delivery => 'all'
      response.should be_redirect
      response.should redirect_to(admin_message_url(messages(:taggy)))
    end
  end
    
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
radiant-reader-extension-3.0.38 spec/controllers/admin/messages_controller_spec.rb
radiant-reader-extension-3.0.37 spec/controllers/admin/messages_controller_spec.rb
radiant-reader-extension-3.0.36 spec/controllers/admin/messages_controller_spec.rb
radiant-reader-extension-3.0.35 spec/controllers/admin/messages_controller_spec.rb
radiant-reader-extension-3.0.33 spec/controllers/admin/messages_controller_spec.rb
radiant-reader-extension-3.0.32 spec/controllers/admin/messages_controller_spec.rb
radiant-reader-extension-3.0.31 spec/controllers/admin/messages_controller_spec.rb
radiant-reader-extension-3.0.30 spec/controllers/admin/messages_controller_spec.rb
radiant-reader-extension-3.0.29 spec/controllers/admin/messages_controller_spec.rb
radiant-reader-extension-3.0.28 spec/controllers/admin/messages_controller_spec.rb
radiant-reader-extension-3.0.27 spec/controllers/admin/messages_controller_spec.rb
radiant-reader-extension-3.0.26 spec/controllers/admin/messages_controller_spec.rb
radiant-reader-extension-3.0.25 spec/controllers/admin/messages_controller_spec.rb
radiant-reader-extension-3.0.24 spec/controllers/admin/messages_controller_spec.rb
radiant-reader-extension-3.0.23 spec/controllers/admin/messages_controller_spec.rb
radiant-reader-extension-3.0.20 spec/controllers/admin/messages_controller_spec.rb
radiant-reader-extension-3.0.19 spec/controllers/admin/messages_controller_spec.rb
radiant-reader-extension-3.0.18 spec/controllers/admin/messages_controller_spec.rb
radiant-reader-extension-3.0.17 spec/controllers/admin/messages_controller_spec.rb
radiant-reader-extension-3.0.16 spec/controllers/admin/messages_controller_spec.rb