Commit 749ea08e authored by Stan Hu's avatar Stan Hu

Merge branch 'fix-diverged-branch-locals' into 'master'

Fix diverged branch locals

See merge request gitlab-org/gitlab-ee!14074
parents 41b22188 e9b8f2e4
# frozen_string_literal: true
require 'spec_helper'
describe Projects::BranchesController do
set(:project) { create(:project, :repository) }
let(:user) { project.owner }
before do
allow(project).to receive(:branches).and_return(['master'])
controller.instance_variable_set(:@project, project)
sign_in(user)
end
describe 'GET #index' do
context 'for mirrored projects with diverged branch' do
render_views
before do
create(:import_state, :mirror, :finished, project: project, last_successful_update_at: Time.now)
allow(project.repository).to receive(:diverged_from_upstream?) { true }
end
it 'renders the diverged from upstream partial' do
get :index,
format: :html,
params: {
namespace_id: project.namespace,
project_id: project,
state: 'all'
}
expect(controller).to render_template('projects/branches/_diverged_from_upstream')
expect(response.body).to match(/diverged from upstream/)
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