summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-03-24 13:30:37 -0700
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-03-24 13:30:37 -0700
commitb7a588892fcd9d683d0391f9fce43df29443918e (patch)
tree1ab734b354eb90c68fc3c86a4c374ca686ba7d0b /spec
parent1a150e144087cdd2d936823401a6d24baa31ad86 (diff)
downloadgitlab-ci-b7a588892fcd9d683d0391f9fce43df29443918e.tar.gz
Add project search at runner page
Diffstat (limited to 'spec')
-rw-r--r--spec/features/admin/runners_spec.rb21
-rw-r--r--spec/models/project_spec.rb9
2 files changed, 28 insertions, 2 deletions
diff --git a/spec/features/admin/runners_spec.rb b/spec/features/admin/runners_spec.rb
index b480894..5fe1130 100644
--- a/spec/features/admin/runners_spec.rb
+++ b/spec/features/admin/runners_spec.rb
@@ -22,9 +22,28 @@ describe "Admin Runners" do
let(:runner) { FactoryGirl.create :runner }
before do
+ FactoryGirl.create(:project, name: "foo")
+ FactoryGirl.create(:project, name: "bar")
visit admin_runner_path(runner)
end
- it { find_field('runner_token').value.should eq runner.token }
+ describe 'runner info' do
+ it { find_field('runner_token').value.should eq runner.token }
+ end
+
+ describe 'projects' do
+ it { page.should have_content("foo") }
+ it { page.should have_content("bar") }
+ end
+
+ describe 'search' do
+ before do
+ fill_in 'search', with: 'foo'
+ click_button 'Search'
+ end
+
+ it { page.should have_content("foo") }
+ it { page.should_not have_content("bar") }
+ end
end
end
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb
index 8ad2c69..6fc6c32 100644
--- a/spec/models/project_spec.rb
+++ b/spec/models/project_spec.rb
@@ -30,7 +30,7 @@ describe Project do
it { should have_many(:commits) }
- it { should validate_presence_of :name }
+ it { should validate_presence_of :name }
it { should validate_presence_of :timeout }
it { should validate_presence_of :default_ref }
@@ -161,4 +161,11 @@ describe Project do
expect(project.skip_ref?('feature/some_feature')).to eq true
end
end
+
+ describe :search do
+ let!(:project) { FactoryGirl.create(:project, name: "foo") }
+
+ it { Project.search('fo').should include(project) }
+ it { Project.search('bar').should be_empty }
+ end
end