Sha256: f1337d0dcceb0737f0883ef264fbbe8b8e738e6c2c0e71b9a64808530d5ae68e

Contents?: true

Size: 1.15 KB

Versions: 5

Compression:

Stored size: 1.15 KB

Contents

require 'test_helper'

class Api::V1::CommonParametersControllerTest < ActionController::TestCase

  valid_attrs = { :name => 'special_key', :value => '123' }

  test "should get index" do
    get :index, { }
    assert_response :success
    assert_not_nil assigns(:common_parameters)
    common_parameters = ActiveSupport::JSON.decode(@response.body)
    assert !common_parameters.empty?
  end

  test "should show parameter" do
    get :show, { :id => parameters(:common).to_param }
    assert_response :success
    show_response = ActiveSupport::JSON.decode(@response.body)
    assert !show_response.empty?
  end

  test "should create common_parameter" do
    assert_difference('CommonParameter.count') do
      post :create, { :common_parameter => valid_attrs }
    end
    assert_response :success
  end

  test "should update common_parameter" do
    put :update, { :id => parameters(:common).to_param, :common_parameter => { } }
    assert_response :success
  end

  test "should destroy common_parameter" do
    assert_difference('CommonParameter.count', -1) do
      delete :destroy, { :id => parameters(:common).to_param }
    end
    assert_response :success
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
foreman_discovery-1.0.0 test/foreman_app/test/functional/api/v1/common_parameters_controller_test.rb
foreman_discovery-1.0.0.rc4 test/foreman_app/test/functional/api/v1/common_parameters_controller_test.rb
foreman_discovery-1.0.0.rc3 test/foreman_app/test/functional/api/v1/common_parameters_controller_test.rb
foreman_discovery-1.0.0.rc2 test/foreman_app/test/functional/api/v1/common_parameters_controller_test.rb
foreman_discovery-1.0.0.rc1 test/foreman_app/test/functional/api/v1/common_parameters_controller_test.rb