Sha256: 338c44683e5aaaf289a8c6183bcc0df1ed50cc4c020f3bf2cee072cba78173c1

Contents?: true

Size: 1.24 KB

Versions: 3

Compression:

Stored size: 1.24 KB

Contents

require File.dirname(__FILE__) + '/../../test_helper'

class Admin::DomainThemesControllerTest < ActionController::TestCase

  def setup
    @controller = Admin::DomainThemesController.new
    @request    = ActionController::TestRequest.new
    @response   = ActionController::TestResponse.new
    @new_uri = 'red.example.com'
  end
  
  context "create the domain theme" do
    setup do
      post :create, :domain_theme => { :name => 'red', :uri => @new_uri }
    end
    should_set_the_flash_to(I18n.t("disguise.theme_updated"))
    should_redirect_to("edit theme") { edit_admin_theme_path }
    should "create a new domain theme" do
      assert_difference 'DomainTheme.count' do
        post :create, :domain_theme => { :name => 'red_too', :uri => 'red_too_unique.example.com' }
      end
    end
  end
  
  context "update the domain theme" do
    setup do
      @domain_theme = Factory(:domain_theme, :name => 'red')
      put :update, :domain_theme => { :name => 'red', :uri => @new_uri }
      @domain_theme.reload
    end
    should "change the domain theme uri" do
      assert_equal @domain_theme.uri, @new_uri
    end
    should_set_the_flash_to(I18n.t("disguise.theme_updated"))
    should_redirect_to("edit theme") { edit_admin_theme_path }
  end
  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
disguise-0.3.1 test/rails_root/test/functional/admin/domain_themes_controller_test.rb
disguise-0.3.2 test/rails_root/test/functional/admin/domain_themes_controller_test.rb
disguise-0.3.3 test/rails_root/test/functional/admin/domain_themes_controller_test.rb