2018-06-26 12:31:05 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Resolvers::ProjectPipelinesResolver do
|
|
|
|
include GraphqlHelpers
|
|
|
|
|
|
|
|
set(:project) { create(:project) }
|
2019-01-16 07:09:29 -05:00
|
|
|
set(:pipeline) { create(:ci_pipeline, project: project) }
|
2018-06-26 12:31:05 -04:00
|
|
|
set(:other_pipeline) { create(:ci_pipeline) }
|
|
|
|
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
|