Sha256: 518e435245672fb1b306fcf584815ff622ce0d0e7ee8f37b405e093c51de0950

Contents?: true

Size: 1.26 KB

Versions: 17

Compression:

Stored size: 1.26 KB

Contents

require "foreman_tasks_test_helper"

module ForemanRecurringLogic
  class Api::RecurringLogicControllerTest < ActionController::TestCase
    describe 'recurring logic api controller' do
      tests ForemanTasks::Api::RecurringLogicsController

      before do
        User.current = User.where(:login => 'apiadmin').first
        @request.env['HTTP_ACCEPT'] = 'application/json'
        @request.env['CONTENT_TYPE'] = 'application/json'
        @recurring_logic = FactoryGirl.create(:recurring_logic)
      end

      describe 'GET /api/recurring_logics' do
        it 'gets index' do
          get :index
          assert_response :success
          assert_template 'api/recurring_logics/index'
        end
      end

      describe 'GET /api/recurring_logics/:id' do
        it 'searches for recurring logic' do
          get(:show, :id => @recurring_logic.id)
          assert_response :success
          assert_template 'api/recurring_logics/show'
        end
      end

      describe 'POST /api/recurring_logics/:id/cancel' do
        it 'cancels recurring logic' do
          post(:cancel, :id => @recurring_logic.id)
          assert_response :success
          @recurring_logic.reload
          assert @recurring_logic.state == 'cancelled'
        end
      end
    end
  end
end


Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
foreman-tasks-0.8.6 test/controllers/api/recurring_logics_controller_test.rb
foreman-tasks-0.8.5 test/controllers/api/recurring_logics_controller_test.rb
foreman-tasks-0.8.4 test/controllers/api/recurring_logics_controller_test.rb
foreman-tasks-0.8.3 test/controllers/api/recurring_logics_controller_test.rb
foreman-tasks-0.8.2 test/controllers/api/recurring_logics_controller_test.rb
foreman-tasks-0.8.1 test/controllers/api/recurring_logics_controller_test.rb
foreman-tasks-0.8.0 test/controllers/api/recurring_logics_controller_test.rb
foreman-tasks-0.7.20 test/controllers/api/recurring_logics_controller_test.rb
foreman-tasks-0.7.19 test/controllers/api/recurring_logics_controller_test.rb
foreman-tasks-0.7.18 test/controllers/api/recurring_logics_controller_test.rb
foreman-tasks-0.7.17 test/controllers/api/recurring_logics_controller_test.rb
foreman-tasks-0.7.16 test/controllers/api/recurring_logics_controller_test.rb
foreman-tasks-0.7.15 test/controllers/api/recurring_logics_controller_test.rb
foreman-tasks-0.7.14 test/controllers/api/recurring_logics_controller_test.rb
foreman-tasks-0.7.13 test/controllers/api/recurring_logics_controller_test.rb
foreman-tasks-0.7.12 test/controllers/api/recurring_logics_controller_test.rb
foreman-tasks-0.7.11 test/controllers/api/recurring_logics_controller_test.rb