summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorWinnie Hellmann <winnie@gitlab.com>2019-04-21 12:00:13 +0200
committerWinnie Hellmann <winnie@gitlab.com>2019-05-10 14:12:19 +0200
commitd14e25e955f2ca2f8dce569288431e897f1434d1 (patch)
treec3998c4448e8a2f7a11fe7d4db4417e60e497688 /spec
parent9d4450263fd7dc53dafd62389871d8b1fcea5e1a (diff)
downloadgitlab-ce-d14e25e955f2ca2f8dce569288431e897f1434d1.tar.gz
Call store_frontend_fixture() in JavaScriptFixturesHelpers
Diffstat (limited to 'spec')
-rw-r--r--spec/support/helpers/javascript_fixtures_helpers.rb18
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