Sha256: 42252ea57af8414d3d5fed3c27f9424bc94845f2994bf77108f9dc9732322e2f

Contents?: true

Size: 1.11 KB

Versions: 15

Compression:

Stored size: 1.11 KB

Contents

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

class Admin::ThemesControllerTest < ActionController::TestCase

  def setup
    @controller = Admin::ThemesController.new
    @request    = ActionController::TestRequest.new
    @response   = ActionController::TestResponse.new
  end

  context "get edit page - no themes" do
    setup do
      @themes = mock()
      @current_theme = mock()
      @themes.stubs(:empty?).returns(true)
      Theme.stubs(:available_themes).returns([@current_theme, @themes])
      get :edit
    end
    should_respond_with :success
    should_render_template 'admin/themes/no_themes'
  end

  context "get edit page" do
    setup do
      get :edit
    end
    should_respond_with :success
    should_render_template 'admin/themes/edit'
  end
  
  context "update the current theme" do
    setup do
      setup_theme
      put :update, :theme => { :name => 'red' }
    end
    should "change the current theme" do
      assert_equal Theme.first.name, 'red'
    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

15 entries across 15 versions & 1 rubygems

Version Path
disguise-2.0.0 test/rails_root/test/functional/admin/themes_controller_test.rb
disguise-0.4.0 test/rails_root/test/functional/admin/themes_controller_test.rb
disguise-0.3.12 test/rails_root/test/functional/admin/themes_controller_test.rb
disguise-0.3.11 test/rails_root/test/functional/admin/themes_controller_test.rb
disguise-0.3.10 test/rails_root/test/functional/admin/themes_controller_test.rb
disguise-0.3.8 test/rails_root/test/functional/admin/themes_controller_test.rb
disguise-0.3.7 test/rails_root/test/functional/admin/themes_controller_test.rb
disguise-0.3.6 test/rails_root/test/functional/admin/themes_controller_test.rb
disguise-0.3.1 test/rails_root/test/functional/admin/themes_controller_test.rb
disguise-0.3.2 test/rails_root/test/functional/admin/themes_controller_test.rb
disguise-0.3.3 test/rails_root/test/functional/admin/themes_controller_test.rb
disguise-0.3.4 test/rails_root/test/functional/admin/themes_controller_test.rb
disguise-0.3.5 test/rails_root/test/functional/admin/themes_controller_test.rb
disguise-0.2.0 test/rails_root/test/functional/admin/themes_controller_test.rb
disguise-0.3.0 test/rails_root/test/functional/admin/themes_controller_test.rb