Sha256: 372feeb15b27b6809eb1fb922a1af606ab8abbf3a0a643ae0dd93f9ed7d36cf9
Contents?: true
Size: 1.08 KB
Versions: 44
Compression:
Stored size: 1.08 KB
Contents
require 'test_puppet_helper' module ForemanPuppet module Api module V2 class ConfigGroupsControllerTest < ActionController::TestCase setup do @routes = ForemanPuppet::Engine.routes end let(:puppetclasses) { FactoryBot.create_list(:puppetclass, 2) } let(:config_group) { FactoryBot.create(:config_group) } test 'should create config group' do assert_difference('ConfigGroup.count') do post :create, params: { config_group: { name: 'config-group', puppetclass_ids: puppetclasses.map(&:id) } } end assert_response :created end test 'should update config group' do name = 'new name' put :update, params: { id: config_group.to_param, config_group: { name: name, puppetclass_ids: puppetclasses.map(&:id) } } assert_response :success response = JSON.parse(@response.body) assert_equal 2, response['puppetclasses'].count end end end end end
Version data entries
44 entries across 44 versions & 1 rubygems