Commit d14e25e9 authored by Winnie Hellmann's avatar Winnie Hellmann

Call store_frontend_fixture() in JavaScriptFixturesHelpers

parent 9d445026
......@@ -11,6 +11,10 @@ module JavaScriptFixturesHelpers
base.around do |example|
# pick an arbitrary date from the past, so tests are not time dependent
Timecop.freeze(Time.utc(2015, 7, 3, 10)) { example.run }
raise NoMethodError.new('You need to set `response` for the fixture generator! This will automatically happen with `type: :controller` or `type: :request`.', 'response') unless respond_to?(:response)
store_frontend_fixture(response, example.description)
end
end
......@@ -29,7 +33,13 @@ module JavaScriptFixturesHelpers
end
end
# Public: Store a response object as fixture file
def remove_repository(project)
Gitlab::Shell.new.remove_repository(project.repository_storage, project.disk_path)
end
private
# Private: Store a response object as fixture file
#
# response - string or response object to store
# fixture_file_name - file name to store the fixture in (relative to .fixture_root_path)
......@@ -42,12 +52,6 @@ module JavaScriptFixturesHelpers
File.write(full_fixture_path, fixture)
end
def remove_repository(project)
Gitlab::Shell.new.remove_repository(project.repository_storage, project.disk_path)
end
private
# Private: Prepare a response object for use as a frontend fixture
#
# response - response object to prepare
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment