Sha256: 988b02a166f061935ad96afaead4d681deb3387b7aa3fb1c4e20954fb890b84c

Contents?: true

Size: 815 Bytes

Versions: 9

Compression:

Stored size: 815 Bytes

Contents

require 'test_helper'

module AdvertSelector
  class MainControllerTest < ActionController::TestCase

    setup do
      AdvertSelector.admin_access_class = AdvertSelector::AdminAccessClassAlwaysTrue
      @routes = AdvertSelector::Engine.routes # This would be same as calling get :index, :use_route => :advert_selector
    end

    test "should get index" do
      get :index
      assert_response :success
    end

    test "should clear errors log" do
      AdvertSelector::ErrorsCache.add('str')
      get :clear_errors_log
      assert_response :redirect
      assert AdvertSelector::ErrorsCache.errors.blank?
    end

    test "forbidden with default access" do
      AdvertSelector.admin_access_class = AdvertSelector::AdminAccessClassDefault
      get :index
      assert_response 403
    end
  
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
advert_selector-3.0.1 test/functional/advert_selector/main_controller_test.rb
advert_selector-3.0.0 test/functional/advert_selector/main_controller_test.rb
advert_selector-2.0.1 test/functional/advert_selector/main_controller_test.rb
advert_selector-2.0.0 test/functional/advert_selector/main_controller_test.rb
advert_selector-1.0.4 test/functional/advert_selector/main_controller_test.rb
advert_selector-1.0.3 test/functional/advert_selector/main_controller_test.rb
advert_selector-1.0.2 test/functional/advert_selector/main_controller_test.rb
advert_selector-1.0.1 test/functional/advert_selector/main_controller_test.rb
advert_selector-1.0.0 test/functional/advert_selector/main_controller_test.rb