show.html.haml_spec.rb 977 Б
Newer Older
winniehell's avatar
winniehell включено в состав коммита
1
2
3
require 'spec_helper'

describe 'projects/tree/show' do
Connor Shea's avatar
Connor Shea включено в состав коммита
4
  include Devise::Test::ControllerHelpers
winniehell's avatar
winniehell включено в состав коммита
5

Robert Speicher's avatar
Robert Speicher включено в состав коммита
6
  let(:project) { create(:project, :repository) }
winniehell's avatar
winniehell включено в состав коммита
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
  let(:repository) { project.repository }

  before do
    assign(:project, project)
    assign(:repository, repository)

    allow(view).to receive(:can?).and_return(true)
    allow(view).to receive(:can_collaborate_with_project?).and_return(true)
  end

  context 'for branch names ending on .json' do
    let(:ref) { 'ends-with.json' }
    let(:commit) { repository.commit(ref) }
    let(:path) { '' }
    let(:tree) { repository.tree(commit.id, path) }

    before do
      assign(:ref, ref)
      assign(:commit, commit)
      assign(:id, commit.id)
      assign(:tree, tree)
      assign(:path, path)
    end

    it 'displays correctly' do
      render
      expect(rendered).to have_css('.js-project-refs-dropdown .dropdown-toggle-text', text: ref)
Douwe Maan's avatar
Douwe Maan включено в состав коммита
34
      expect(rendered).to have_css('.readme-holder')
winniehell's avatar
winniehell включено в состав коммита
35
36
37
    end
  end
end