BigW Consortium Gitlab

Commit 7fd3a588 by Phil Hughes

Changed spec to a view spec

parent 06473943
require 'spec_helper'
describe 'Commit container', :js, :feature do
let(:user) { create(:user) }
let(:project) { create(:project) }
before do
project.team << [user, :master]
login_as(user)
end
it 'keeps container-limited when view type is inline' do
visit namespace_project_commit_path(project.namespace, project, project.commit.id, view: :inline)
expect(page).not_to have_selector('.limit-container-width')
end
it 'diff spans full width when view type is parallel' do
visit namespace_project_commit_path(project.namespace, project, project.commit.id, view: :parallel)
expect(page).to have_selector('.limit-container-width')
end
end
require 'spec_helper'
describe 'projects/commit/show.html.haml', :view do
let(:user) { create(:user) }
let(:project) { create(:project, :repository) }
before do
assign(:project, project)
assign(:repository, project.repository)
assign(:commit, project.commit)
assign(:noteable, project.commit)
assign(:notes, [])
assign(:diffs, project.commit.diffs)
allow(view).to receive(:current_user).and_return(user)
allow(view).to receive(:can?).and_return(false)
allow(view).to receive(:can_collaborate_with_project?).and_return(false)
allow(view).to receive(:current_ref).and_return(project.repository.root_ref)
allow(view).to receive(:diff_btn).and_return('')
end
context 'inline diff view' do
before do
allow(view).to receive(:diff_view).and_return(:inline)
render
end
it 'keeps container-limited' do
expect(rendered).not_to have_selector('.limit-container-width')
end
end
context 'parallel diff view' do
before do
allow(view).to receive(:diff_view).and_return(:parallel)
render
end
it 'spans full width' do
expect(rendered).to have_selector('.limit-container-width')
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