Sha256: 9dac0c4dcc4908e303797e5683334920268781fb8b5ac4a172c854bda9e0a173

Contents?: true

Size: 1.24 KB

Versions: 2

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
  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
      @new_uri = 'red.example.com'
      @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

2 entries across 2 versions & 1 rubygems

Version Path
disguise-0.2.0 test/rails_root/test/functional/admin/domain_themes_controller_test.rb
disguise-0.3.0 test/rails_root/test/functional/admin/domain_themes_controller_test.rb