Sha256: 33d0dfe953661db96a1cd2354299b4a25d05398bd0a7ce632e848aeb9d915ae2

Contents?: true

Size: 1.08 KB

Versions: 5

Compression:

Stored size: 1.08 KB

Contents

require 'test_helper'

class Api::V1::HostgroupsControllerTest < ActionController::TestCase

  valid_attrs = { :name => 'TestHostgroup' }

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

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

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

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

  test "should destroy hostgroups" do
    assert_difference('Hostgroup.count', -1) do
      delete :destroy, { :id => hostgroups(: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/hostgroups_controller_test.rb
foreman_discovery-1.0.0.rc4 test/foreman_app/test/functional/api/v1/hostgroups_controller_test.rb
foreman_discovery-1.0.0.rc3 test/foreman_app/test/functional/api/v1/hostgroups_controller_test.rb
foreman_discovery-1.0.0.rc2 test/foreman_app/test/functional/api/v1/hostgroups_controller_test.rb
foreman_discovery-1.0.0.rc1 test/foreman_app/test/functional/api/v1/hostgroups_controller_test.rb