Commit 68efbbbb authored by Nathan Friend's avatar Nathan Friend Committed by Natalia Tepluhina

Add FE fixture for all_releases_query.graphql

This commit adds a frontend fixture that represents that response of
the  all_releases_query.graphql query.
parent 0137ae41
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe 'Releases (JavaScript fixtures)' do RSpec.describe 'Releases (JavaScript fixtures)' do
include ApiHelpers
include JavaScriptFixturesHelpers include JavaScriptFixturesHelpers
let_it_be(:admin) { create(:admin) } let_it_be(:admin) { create(:admin) }
...@@ -68,16 +69,14 @@ RSpec.describe 'Releases (JavaScript fixtures)' do ...@@ -68,16 +69,14 @@ RSpec.describe 'Releases (JavaScript fixtures)' do
link_type: :runbook) link_type: :runbook)
end end
before(:all) do
clean_frontend_fixtures('api/releases/')
end
after(:all) do after(:all) do
remove_repository(project) remove_repository(project)
end end
describe API::Releases, '(JavaScript fixtures)', type: :request do describe API::Releases, type: :request do
include ApiHelpers before(:all) do
clean_frontend_fixtures('api/releases/')
end
it 'api/releases/release.json' do it 'api/releases/release.json' do
get api("/projects/#{project.id}/releases/#{release.tag}", admin) get api("/projects/#{project.id}/releases/#{release.tag}", admin)
...@@ -85,4 +84,22 @@ RSpec.describe 'Releases (JavaScript fixtures)' do ...@@ -85,4 +84,22 @@ RSpec.describe 'Releases (JavaScript fixtures)' do
expect(response).to be_successful expect(response).to be_successful
end end
end end
graphql_query_path = 'releases/queries/all_releases.query.graphql'
describe "~/#{graphql_query_path}", type: :request do
include GraphqlHelpers
before(:all) do
clean_frontend_fixtures('graphql/releases/')
end
it "graphql/#{graphql_query_path}.json" do
query = File.read(File.join(Rails.root, '/app/assets/javascripts', graphql_query_path))
post_graphql(query, current_user: admin, variables: { fullPath: project.full_path })
expect_graphql_errors_to_be_empty
end
end
end end
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