diff options
Diffstat (limited to 'spec/support/helpers/javascript_fixtures_helpers.rb')
-rw-r--r-- | spec/support/helpers/javascript_fixtures_helpers.rb | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/spec/support/helpers/javascript_fixtures_helpers.rb b/spec/support/helpers/javascript_fixtures_helpers.rb index 494398dc4de..cdd7724cc13 100644 --- a/spec/support/helpers/javascript_fixtures_helpers.rb +++ b/spec/support/helpers/javascript_fixtures_helpers.rb @@ -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 |