blob: a635d0670e3959cb27aeec06ca942203ec539f1b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# use with @tempfile, @config
Given /there is a config for the (.*)$/ do |config|
@dummy_config = {dummy_config_for: config}.to_json
@tempfile = Tempfile.new("#{config}.json")
@tempfile.write @dummy_config
@tempfile.close
@orig_config ||= APP_CONFIG.dup
config = "#{config}-service" unless config == 'provider'
APP_CONFIG[:config_file_paths].merge! config => @tempfile.path
end
# use with @config
Given /^"([^"]*)" is (enabled|disabled|"[^"]") in the config$/ do |key, value|
@orig_config ||= APP_CONFIG.dup
value = case value
when 'disabled' then false
when 'enabled' then true
else value.gsub('"', '')
end
APP_CONFIG.merge! key => value
end
Then /^the response should be that config$/ do
assert_equal @dummy_config, last_response.body
end
|