admin_projects_spec.rb 691 Bytes
Newer Older
gitlabhq's avatar
gitlabhq committed
1 2
require 'spec_helper'

3
describe "Admin::Projects", feature: true  do
Nihad Abbasov's avatar
Nihad Abbasov committed
4
  before do
5
    @project = create(:project)
gitlabhq's avatar
gitlabhq committed
6 7 8 9
    login_as :admin
  end

  describe "GET /admin/projects" do
Nihad Abbasov's avatar
Nihad Abbasov committed
10
    before do
gitlabhq's avatar
gitlabhq committed
11 12 13 14 15 16 17
      visit admin_projects_path
    end

    it "should be ok" do
      current_path.should == admin_projects_path
    end

Nihad Abbasov's avatar
Nihad Abbasov committed
18
    it "should have projects list" do
gitlabhq's avatar
gitlabhq committed
19 20 21 22
      page.should have_content(@project.name)
    end
  end

Nihad Abbasov's avatar
Nihad Abbasov committed
23 24
  describe "GET /admin/projects/:id" do
    before do
gitlabhq's avatar
gitlabhq committed
25
      visit admin_projects_path
Saito's avatar
Saito committed
26
      click_link "#{@project.name}"
gitlabhq's avatar
gitlabhq committed
27 28
    end

Nihad Abbasov's avatar
Nihad Abbasov committed
29
    it "should have project info" do
30
      page.should have_content(@project.path)
gitlabhq's avatar
gitlabhq committed
31 32 33 34
      page.should have_content(@project.name)
    end
  end
end