Sha256: 66affce5c42b8a2fdb648c3c2f8f6647448ce7b4322f7f78fc08072224017bba

Contents?: true

Size: 1.14 KB

Versions: 100

Compression:

Stored size: 1.14 KB

Contents

require 'test_helper'
require 'foreman_tasks_test_helper'

module ForemanTasks
  class RecurringLogicsControllerTest < ActionController::TestCase
    describe ForemanTasks::RecurringLogicsController do
      basic_index_test('recurring_logics')
      basic_pagination_per_page_test

      # rubocop:disable Naming/AccessorMethodName
      def get_factory_name
        :recurring_logic
      end
      # rubocop:enable Naming/AccessorMethodName

      describe 'PUT /recurring_logics/ID/enable' do
        let(:recurring_logic) do
          recurring_logic = FactoryBot.create(:recurring_logic)
          recurring_logic.start(::Support::DummyRecurringDynflowAction)
          recurring_logic
        end

        it 'disables' do
          put :enable, params: { :id => recurring_logic.id }, session: set_session_user
          assert_redirected_to '/foreman_tasks/recurring_logics'
        end

        it 'enables' do
          recurring_logic.update(:enabled => false)
          put :disable, params: { :id => recurring_logic.id }, session: set_session_user

          assert_redirected_to '/foreman_tasks/recurring_logics'
        end
      end
    end
  end
end

Version data entries

100 entries across 100 versions & 1 rubygems

Version Path
foreman-tasks-0.16.1 test/controllers/recurring_logics_controller_test.rb
foreman-tasks-0.17.0 test/controllers/recurring_logics_controller_test.rb
foreman-tasks-0.15.9 test/controllers/recurring_logics_controller_test.rb
foreman-tasks-0.15.8 test/controllers/recurring_logics_controller_test.rb
foreman-tasks-0.14.6 test/controllers/recurring_logics_controller_test.rb
foreman-tasks-0.15.7 test/controllers/recurring_logics_controller_test.rb
foreman-tasks-0.16.0 test/controllers/recurring_logics_controller_test.rb
foreman-tasks-0.15.6 test/controllers/recurring_logics_controller_test.rb
foreman-tasks-0.15.5 test/controllers/recurring_logics_controller_test.rb
foreman-tasks-0.15.4 test/controllers/recurring_logics_controller_test.rb
foreman-tasks-0.15.3 test/controllers/recurring_logics_controller_test.rb
foreman-tasks-0.15.2 test/controllers/recurring_logics_controller_test.rb
foreman-tasks-0.15.1 test/controllers/recurring_logics_controller_test.rb
foreman-tasks-0.15.0 test/controllers/recurring_logics_controller_test.rb
foreman-tasks-0.14.5 test/controllers/recurring_logics_controller_test.rb
foreman-tasks-0.14.4 test/controllers/recurring_logics_controller_test.rb
foreman-tasks-0.14.3 test/controllers/recurring_logics_controller_test.rb
foreman-tasks-0.14.2 test/controllers/recurring_logics_controller_test.rb
foreman-tasks-0.14.1 test/controllers/recurring_logics_controller_test.rb
foreman-tasks-0.14.0 test/controllers/recurring_logics_controller_test.rb