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-10.0.1 test/controllers/recurring_logics_controller_test.rb
foreman-tasks-10.0.0 test/controllers/recurring_logics_controller_test.rb
foreman-tasks-9.2.3 test/controllers/recurring_logics_controller_test.rb
foreman-tasks-9.2.2 test/controllers/recurring_logics_controller_test.rb
foreman-tasks-9.2.1 test/controllers/recurring_logics_controller_test.rb
foreman-tasks-9.2.0 test/controllers/recurring_logics_controller_test.rb
foreman-tasks-9.1.1 test/controllers/recurring_logics_controller_test.rb
foreman-tasks-9.0.4 test/controllers/recurring_logics_controller_test.rb
foreman-tasks-9.1.0 test/controllers/recurring_logics_controller_test.rb
foreman-tasks-9.0.2 test/controllers/recurring_logics_controller_test.rb
foreman-tasks-9.0.1 test/controllers/recurring_logics_controller_test.rb
foreman-tasks-8.3.3 test/controllers/recurring_logics_controller_test.rb
foreman-tasks-9.0.0 test/controllers/recurring_logics_controller_test.rb
foreman-tasks-8.2.1 test/controllers/recurring_logics_controller_test.rb
foreman-tasks-8.1.4 test/controllers/recurring_logics_controller_test.rb
foreman-tasks-8.3.2 test/controllers/recurring_logics_controller_test.rb
foreman-tasks-8.3.1 test/controllers/recurring_logics_controller_test.rb
foreman-tasks-8.1.3 test/controllers/recurring_logics_controller_test.rb
foreman-tasks-8.3.0 test/controllers/recurring_logics_controller_test.rb
foreman-tasks-8.2.0 test/controllers/recurring_logics_controller_test.rb