2019-10-17 05:07:07 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-06-26 12:31:05 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-24 05:08:32 -04:00
|
|
|
RSpec.describe Resolvers::ProjectPipelinesResolver do
|
2018-06-26 12:31:05 -04:00
|
|
|
include GraphqlHelpers
|
|
|
|
|
2020-02-18 10:08:51 -05:00
|
|
|
let_it_be(:project) { create(:project) }
|
|
|
|
let_it_be(:pipeline) { create(:ci_pipeline, project: project) }
|
|
|
|
let_it_be(:other_pipeline) { create(:ci_pipeline) }
|
2018-06-26 12:31:05 -04:00
|
|
|
let(:current_user) { create(:user) }
|
|
|
|
|
|
|
|
before do
|
|
|
|
project.add_developer(current_user)
|
|
|
|
end
|
|
|
|
|
|
|
|
def resolve_pipelines
|
|
|
|
resolve(described_class, obj: project, ctx: { current_user: current_user })
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'resolves only MRs for the passed merge request' do
|
|
|
|
expect(resolve_pipelines).to contain_exactly(pipeline)
|
|
|
|
end
|
|
|
|
end
|