class Object

Public Instance Methods

default?(name) click to toggle source
# File lib/scenarios/application/app_helpers.rb, line 18
def default?(name)
  name == "default"
end
get_fixture(route_type, path, scenario_name) click to toggle source
# File lib/scenarios/application/app_helpers.rb, line 22
def get_fixture(route_type, path, scenario_name)
  status_code, header, fixture = self.scenario_db.get_fixture_from_routes(route_type, path, scenario_name)
  
  if fixture.nil? and default?(scenario_name)
    status_code, header, fixture = self.scenario_db.get_fixture_from_routes(route_type, path, 'default')
  end

        if status_code == nil 
          status_code = 200
        end
  return status_code, header, fixture
end
valid_scenario(scenario_name) click to toggle source
# File lib/scenarios/application/app_helpers.rb, line 13
def valid_scenario (scenario_name)
  scenarios = self.scenario_db.get_scenario_names
  scenarios.include?(scenario_name)
end
validate_json_string(fixture) click to toggle source
# File lib/scenarios/application/app_helpers.rb, line 4
def validate_json_string (fixture)
  begin
    data = JSON.parse(fixture)
    return true
  rescue JSON::ParserError => e
    return false
  end
end