test/common.rb in fastly-1.5.0 vs test/common.rb in fastly-1.6.0
- old
+ new
@@ -99,18 +99,10 @@
assert_equal number.to_s, director.version.number.to_s
assert director.add_backend(backend)
# generated2 = version3.generated_vcl
- origin_name = "fastly-test-origin-#{random_string}"
- origin = @fastly.create_origin(:service_id => service.id, :version => number, :name => origin_name)
- assert origin
- assert_equal origin_name, origin.name
- assert_equal service.id, origin.service.id
- assert_equal number.to_s, origin.version_number.to_s
- # assert_equal origin.version.number.to_s, number.to_s
-
condition_name = "fastly-test-condition-#{random_string}"
condition_statement = 'req.url ~ "^/foo"'
condition = @fastly.create_condition(:service_id => service.id, :version => number, :name => condition_name, :statement => condition_statement, :type => 'REQUEST')
assert condition
assert_equal condition_name, condition.name
@@ -147,18 +139,18 @@
assert_equal 'short and stout', response_obj.content
response_condition_name = "fastly-response-condition-#{random_string}"
response_condition = @fastly.create_condition(:service_id => service.id, :version => number, :name => response_condition_name, :statement => condition_statement, :type => 'RESPONSE')
header_name = "fastly-header-test-#{random_string}"
- header = @fastly.create_header(:service_id => service.id, :version => number, :name => header_name, :response_condition => response_condition.name, :ignore_if_set => 1, :type => 'response', :dst => 'http.Cache-Control', :src => '"max-age=301"', :priority => 10, :action => 'set', :regex => /foo/)
+ header = @fastly.create_header(:service_id => service.id, :version => number, :name => header_name, :response_condition => response_condition.name, :ignore_if_set => 1, :type => 'response', :dst => 'http.Cache-Control', :src => '"max-age=301"', :priority => 10, :action => 'set', :regex => 'foo')
assert header
assert_equal header_name, header.name
assert_equal response_condition.name, header.response_condition
assert_equal '1', header.ignore_if_set.to_s
assert_equal 'http.Cache-Control', header.dst
assert_equal '"max-age=301"', header.src
assert_equal 'set', header.action
- assert_equal(/foo/, header.regex)
+ assert_equal('foo', header.regex)
assert version3.activate!
assert version3.deactivate!
assert !@fastly.get_service(version3.service_id).version.active
assert !@fastly.get_service(version3.service_id).version.active?