end
end
end
-
end
# Test that a request allows the API key with HTTP BASIC
@token = Token.create!(:user => @user, :action => 'api')
send(http_method, url, parameters, credentials(@token.value, 'X'))
end
-
should_respond_with success_code
should_respond_with_content_type_based_on_url(url)
should_be_a_valid_response_string_based_on_url(url)
@token = Token.create!(:user => @user, :action => 'feeds')
send(http_method, url, parameters, credentials(@token.value, 'X'))
end
-
should_respond_with failure_code
should_respond_with_content_type_based_on_url(url)
should "not login as the user" do
end
send(http_method, request_url, parameters)
end
-
should_respond_with success_code
should_respond_with_content_type_based_on_url(url)
should_be_a_valid_response_string_based_on_url(url)
end
send(http_method, request_url, parameters)
end
-
should_respond_with failure_code
should_respond_with_content_type_based_on_url(url)
should "not login as the user" do
@token = Token.create!(:user => @user, :action => 'api')
send(http_method, url, parameters, {'X-Redmine-API-Key' => @token.value.to_s})
end
-
should_respond_with success_code
should_respond_with_content_type_based_on_url(url)
should_be_a_valid_response_string_based_on_url(url)
else
raise "Unknown content type for should_respond_with_content_type_based_on_url: #{url}"
end
-
end
# Uses the url to assert which format the response should be in
else
raise "Unknown content type for should_be_a_valid_response_based_on_url: #{url}"
end
-
end
# Checks that the response is a valid JSON string