summaryrefslogtreecommitdiff
path: root/spec/features/admin/runners_spec.rb
blob: b4808940df506a639a83e67892fc7d64b55f9507 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
require 'spec_helper'

describe "Admin Runners" do
  before do
    skip_admin_auth
    login_as :user
  end

  describe "GET /admin/runners" do
    before do
      runner = FactoryGirl.create(:runner)
      commit = FactoryGirl.create(:commit)
      FactoryGirl.create(:build, commit: commit, runner_id: runner.id)
      visit admin_runners_path
    end

    it { page.has_text? "Manage Runners" }
    it { page.has_text? "To register a new runner" }
  end

  describe "GET /admin/runners/:id" do
    let(:runner) { FactoryGirl.create :runner }

    before do
      visit admin_runner_path(runner)
    end

    it { find_field('runner_token').value.should eq runner.token }
  end
end