Skip to content

Commit

Permalink
[api] Added test cases for config file on source controller
Browse files Browse the repository at this point in the history
  • Loading branch information
Moisés Déniz Alemán committed Oct 13, 2015
1 parent 45b2c3e commit e4a2fb6
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/api/test/functional/source_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@
class SourceControllerTest < ActionDispatch::IntegrationTest
fixtures :all

CONFIG_FILE_STRING_FOR_HOME_IGGY_PROJECT = 'Type: spec
Substitute: kiwi package
Substitute: kiwi-packagemanager:instsource package
Ignore: package:bash'

NEW_CONFIG_FILE_STRING_FOR_HOME_IGGY_PROJECT = 'Type: spec
Substitute: kiwi package
Substitute: kiwi-packagemanager:instsource package
Ignore: package:bash
Ignore: package:cups'

def setup
super
wait_for_scheduler_start
Expand Down Expand Up @@ -3593,5 +3604,28 @@ def test_issue_328
:parent => { :tag => "repository", :attributes => { :name => "standard" } }
assert_xml_tag :tag => "repository", :attributes => {:name => "standard2"}
end

def test_config_file
login_Iggy

get '/source/home:Iggy/_config'
assert_response :success
assert_equal @response.body, CONFIG_FILE_STRING_FOR_HOME_IGGY_PROJECT
end

def test_updating_config_file
login_Iggy

put '/source/home:Iggy/_config?' + {
project: 'home:Iggy',
comment: 'Updated by test'
}.to_query, NEW_CONFIG_FILE_STRING_FOR_HOME_IGGY_PROJECT
assert_response :success

get '/source/home:Iggy/_config'
assert_response :success
assert_equal @response.body, NEW_CONFIG_FILE_STRING_FOR_HOME_IGGY_PROJECT
end

end
# rubocop:enable Metrics/LineLength

0 comments on commit e4a2fb6

Please sign in to comment.