Skip to content
Snippets Groups Projects
Commit fd6be573 authored by Valery Sizov's avatar Valery Sizov
Browse files

Merge branch 'rs-rspec3' into 'master'

RSpec 3

Updates CI's specs to be a bit more like CE's to make that transition a little easier.

See merge request !246
parents 305d9e20 77053a6c
No related branches found
No related tags found
No related merge requests found
Showing
with 193 additions and 193 deletions
--color
--color --format Fuubar
Loading
Loading
@@ -103,37 +103,39 @@ gem "unf"
 
group :development do
gem 'brakeman', require: false
gem 'rack-mini-profiler', require: false
gem 'annotate'
gem 'quiet_assets'
gem "letter_opener"
gem "spring-commands-rspec"
gem 'quiet_assets'
gem 'rack-mini-profiler', require: false
end
 
 
group :development, :test do
gem 'spring', '~> 1.3.6'
gem 'minitest'
gem 'pry'
gem 'rspec-rails'
gem 'capybara'
gem 'poltergeist', '~> 1.5.1'
gem 'byebug', platform: :mri
gem 'fuubar', '~> 2.0.0'
gem 'pry-rails'
gem "database_cleaner", '~> 1.4.0'
gem 'factory_girl_rails'
gem "ffaker"
gem "byebug"
gem "database_cleaner"
gem 'shoulda-matchers'
gem 'guard-rspec'
gem 'rb-fsevent', require: darwin_only('rb-fsevent')
gem 'growl', require: darwin_only('growl')
gem 'rb-inotify', require: linux_only('rb-inotify')
gem "simplecov", require: false
gem 'rspec-rails', '~> 3.3.0'
gem 'rubocop', '0.28.0', require: false
gem 'capybara', '~> 2.4.0'
gem 'capybara-screenshot', '~> 1.0.0'
gem 'poltergeist', '~> 1.6.0'
gem 'spring', '~> 1.3.6'
gem 'spring-commands-rspec', '~> 1.0.0'
gem 'minitest'
gem 'ffaker', '~> 2.0.0'
gem 'coveralls', '~> 0.8.2', require: false
gem 'rubocop', '0.28.0', require: false
end
 
group :test do
gem 'webmock'
gem 'email_spec'
gem 'simplecov', require: false
gem 'shoulda-matchers', '~> 2.8.0', require: false
gem 'email_spec', '~> 1.6.0'
gem 'webmock', '~> 1.21.0'
end
Loading
Loading
@@ -35,7 +35,7 @@ GEM
tzinfo (~> 1.1)
acts-as-taggable-on (3.4.3)
activerecord (>= 3.2, < 5)
addressable (2.3.5)
addressable (2.3.8)
annotate (2.6.0)
activerecord (>= 2.3.0)
rake (>= 0.8.7)
Loading
Loading
@@ -64,12 +64,15 @@ GEM
byebug (3.2.0)
columnize (~> 0.8)
debugger-linecache (~> 1.2)
capybara (2.1.0)
capybara (2.4.4)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (~> 2.0)
capybara-screenshot (1.0.11)
capybara (>= 1.0, < 3)
launchy
celluloid (0.15.2)
timers (~> 1.1.0)
chronic (0.10.2)
Loading
Loading
@@ -93,9 +96,9 @@ GEM
simplecov (~> 0.10.0)
term-ansicolor (~> 1.3)
thor (~> 0.19.1)
crack (0.4.1)
safe_yaml (~> 0.9.0)
database_cleaner (1.3.0)
crack (0.4.2)
safe_yaml (~> 1.0.0)
database_cleaner (1.4.1)
debugger-linecache (1.2.0)
default_value_for (3.0.0.1)
activerecord (>= 3.2.0, < 5.0)
Loading
Loading
@@ -106,7 +109,7 @@ GEM
domain_name (0.5.24)
unf (>= 0.0.5, < 1.0.0)
dotenv (0.9.0)
email_spec (1.5.0)
email_spec (1.6.0)
launchy (~> 2.1)
mail (~> 2.2)
encryptor (1.3.0)
Loading
Loading
@@ -122,8 +125,7 @@ GEM
faraday (0.9.1)
multipart-post (>= 1.2, < 3)
fastercsv (1.5.5)
ffaker (1.22.1)
ffi (1.9.3)
ffaker (2.0.0)
fission (0.5.0)
CFPropertyList (~> 2.2)
fog (1.25.0)
Loading
Loading
@@ -187,6 +189,9 @@ GEM
dotenv (>= 0.7)
thor (>= 0.13.6)
formatador (0.2.4)
fuubar (2.0.0)
rspec (~> 3.0)
ruby-progressbar (~> 1.4)
gitlab_ci_meta (4.0)
grape (0.6.1)
activesupport
Loading
Loading
@@ -201,16 +206,6 @@ GEM
grape-entity (0.3.0)
activesupport
multi_json (>= 1.3.2)
growl (1.0.3)
guard (2.2.4)
formatador (>= 0.2.4)
listen (~> 2.1)
lumberjack (~> 1.0)
pry (>= 0.9.12)
thor (>= 0.18.1)
guard-rspec (4.2.0)
guard (>= 2.1.1)
rspec (>= 2.14, < 4.0)
haml (4.0.6)
tilt
haml-rails (0.5.3)
Loading
Loading
@@ -245,15 +240,10 @@ GEM
actionpack (>= 3.0.0)
activesupport (>= 3.0.0)
kgio (2.9.2)
launchy (2.4.2)
launchy (2.4.3)
addressable (~> 2.3)
letter_opener (1.1.2)
letter_opener (1.4.1)
launchy (~> 2.2)
listen (2.4.0)
celluloid (>= 0.15.2)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
lumberjack (1.0.4)
mail (2.6.3)
mime-types (>= 1.16, < 3)
method_source (0.8.2)
Loading
Loading
@@ -288,16 +278,18 @@ GEM
parser (2.2.0.2)
ast (>= 1.1, < 3.0)
pg (0.17.0)
poltergeist (1.5.1)
poltergeist (1.6.0)
capybara (~> 2.1)
cliver (~> 0.3.1)
multi_json (~> 1.0)
websocket-driver (>= 0.2.0)
powerpack (0.0.9)
pry (0.9.12.4)
coderay (~> 1.0)
method_source (~> 0.8)
pry (0.10.1)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
pry-rails (0.3.4)
pry (>= 0.9.10)
quiet_assets (1.0.2)
railties (>= 3.1, < 5.0)
rack (1.5.5)
Loading
Loading
@@ -329,9 +321,6 @@ GEM
rainbow (2.0.0)
raindrops (0.13.0)
rake (10.4.2)
rb-fsevent (0.9.3)
rb-inotify (0.9.2)
ffi (>= 0.5.0)
rbvmomi (1.8.2)
builder
nokogiri (>= 1.4.1)
Loading
Loading
@@ -344,21 +333,27 @@ GEM
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 3.0)
netrc (~> 0.7)
rspec (2.14.1)
rspec-core (~> 2.14.0)
rspec-expectations (~> 2.14.0)
rspec-mocks (~> 2.14.0)
rspec-core (2.14.7)
rspec-expectations (2.14.4)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.14.4)
rspec-rails (2.14.0)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 2.14.0)
rspec-expectations (~> 2.14.0)
rspec-mocks (~> 2.14.0)
rspec (3.3.0)
rspec-core (~> 3.3.0)
rspec-expectations (~> 3.3.0)
rspec-mocks (~> 3.3.0)
rspec-core (3.3.2)
rspec-support (~> 3.3.0)
rspec-expectations (3.3.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.3.0)
rspec-mocks (3.3.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.3.0)
rspec-rails (3.3.2)
actionpack (>= 3.0, < 4.3)
activesupport (>= 3.0, < 4.3)
railties (>= 3.0, < 4.3)
rspec-core (~> 3.3.0)
rspec-expectations (~> 3.3.0)
rspec-mocks (~> 3.3.0)
rspec-support (~> 3.3.0)
rspec-support (3.3.0)
rubocop (0.28.0)
astrolabe (~> 1.3)
parser (>= 2.2.0.pre.7, < 3.0)
Loading
Loading
@@ -371,7 +366,7 @@ GEM
sexp_processor (~> 4.0)
ruby_parser (3.6.4)
sexp_processor (~> 4.1)
safe_yaml (0.9.7)
safe_yaml (1.0.4)
sass (3.2.19)
sass-rails (4.0.5)
railties (>= 4.0.0, < 5.0)
Loading
Loading
@@ -380,7 +375,7 @@ GEM
sprockets-rails (~> 2.0)
settingslogic (2.0.9)
sexp_processor (4.5.0)
shoulda-matchers (2.4.0)
shoulda-matchers (2.8.0)
activesupport (>= 3.0.0)
sidekiq (2.17.0)
celluloid (>= 0.15.2)
Loading
Loading
@@ -401,7 +396,7 @@ GEM
slim (2.0.2)
temple (~> 0.6.6)
tilt (>= 1.3.3, < 2.1)
slop (3.4.7)
slop (3.6.0)
spring (1.3.6)
spring-commands-rspec (1.0.4)
spring (>= 0.9.1)
Loading
Loading
@@ -445,10 +440,12 @@ GEM
coercible (~> 1.0)
descendants_tracker (~> 0.0.1)
equalizer (~> 0.0.7)
webmock (1.16.0)
addressable (>= 2.2.7)
webmock (1.21.0)
addressable (>= 2.3.6)
crack (>= 0.3.2)
websocket-driver (0.3.3)
websocket-driver (0.6.2)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.2)
whenever (0.8.4)
activesupport (>= 2.3.4)
chronic (>= 0.6.3)
Loading
Loading
@@ -467,23 +464,23 @@ DEPENDENCIES
bootstrap-sass (~> 3.0)
brakeman
byebug
capybara
capybara (~> 2.4.0)
capybara-screenshot (~> 1.0.0)
coffee-rails (~> 4.0.0)
colored
coveralls (~> 0.8.2)
database_cleaner
database_cleaner (~> 1.4.0)
default_value_for (~> 3.0.0)
email_spec
email_spec (~> 1.6.0)
factory_girl_rails
ffaker
ffaker (~> 2.0.0)
fog (~> 1.25.0)
font-awesome-rails (~> 3.2)
foreman
fuubar (~> 2.0.0)
gitlab_ci_meta (~> 4.0)
grape
grape-entity
growl
guard-rspec
haml-rails (~> 0.5.3)
hipchat (~> 1.5.0)
httparty (= 0.11.0)
Loading
Loading
@@ -498,27 +495,25 @@ DEPENDENCIES
oauth2 (= 1.0.0)
paranoia (~> 2.0)
pg
poltergeist (~> 1.5.1)
pry
poltergeist (~> 1.6.0)
pry-rails
quiet_assets
rack-mini-profiler
rails (= 4.1.12)
rake
rb-fsevent
rb-inotify
request_store
rspec-rails
rspec-rails (~> 3.3.0)
rubocop (= 0.28.0)
sass-rails (~> 4.0.5)
settingslogic
shoulda-matchers
shoulda-matchers (~> 2.8.0)
sidekiq
simplecov
sinatra
slack-notifier (~> 1.0.0)
slim
spring (~> 1.3.6)
spring-commands-rspec
spring-commands-rspec (~> 1.0.0)
sprockets (~> 2.12.3)
stamp
state_machine
Loading
Loading
@@ -527,5 +522,8 @@ DEPENDENCIES
unf
unicorn (~> 4.8.2)
virtus (= 1.0.1)
webmock
webmock (~> 1.21.0)
whenever
BUNDLED WITH
1.10.6
Loading
Loading
@@ -61,8 +61,8 @@ describe ProjectsController do
it "creates project" do
allow(controller).to receive(:reset_cache) { true }
allow(controller).to receive(:current_user) { user }
Network.any_instance.stub(:enable_ci).and_return(true)
Network.any_instance.stub(:project_hooks).and_return(true)
allow_any_instance_of(Network).to receive(:enable_ci).and_return(true)
allow_any_instance_of(Network).to receive(:project_hooks).and_return(true)
 
post :create, { project: JSON.dump(project_dump.to_h) }.with_indifferent_access
 
Loading
Loading
@@ -73,7 +73,7 @@ describe ProjectsController do
it "shows error" do
allow(controller).to receive(:reset_cache) { true }
allow(controller).to receive(:current_user) { user }
User.any_instance.stub(:can_manage_project?).and_return(false)
allow_any_instance_of(User).to receive(:can_manage_project?).and_return(false)
 
post :create, { project: JSON.dump(project_dump.to_h) }.with_indifferent_access
 
Loading
Loading
@@ -97,7 +97,7 @@ describe ProjectsController do
it "searches projects" do
allow(controller).to receive(:reset_cache) { true }
allow(controller).to receive(:current_user) { user }
Network.any_instance.should_receive(:projects).with(hash_including(search: 'str'), :authorized)
expect_any_instance_of(Network).to receive(:projects).with(hash_including(search: 'str'), :authorized)
 
xhr :get, :gitlab, { search: "str", format: "js" }.with_indifferent_access
 
Loading
Loading
FactoryGirl.define do
factory :web_hook do
sequence(:url) { Faker::Internet.uri('http') }
sequence(:url) { FFaker::Internet.uri('http') }
project
end
end
require 'spec_helper'
 
describe "Admin Builds" do
describe "Admin Builds", feature: true do
let(:project) { FactoryGirl.create :project }
let(:commit) { FactoryGirl.create :commit, project: project }
let(:build) { FactoryGirl.create :build, commit: commit }
Loading
Loading
@@ -16,8 +16,8 @@ describe "Admin Builds" do
visit admin_builds_path
end
 
it { page.should have_content "All builds" }
it { page.should have_content build.short_sha }
it { expect(page).to have_content "All builds" }
it { expect(page).to have_content build.short_sha }
end
 
describe "Tabs" do
Loading
Loading
@@ -29,7 +29,7 @@ describe "Admin Builds" do
 
visit admin_builds_path
 
page.all(".build-link").size.should == 4
expect(page.all(".build-link").size).to eq 4
end
 
it "shows pending builds" do
Loading
Loading
@@ -44,10 +44,10 @@ describe "Admin Builds" do
click_on "Pending"
end
 
page.find(".build-link").should have_content(build.id)
page.find(".build-link").should_not have_content(build1.id)
page.find(".build-link").should_not have_content(build2.id)
page.find(".build-link").should_not have_content(build3.id)
expect(page.find(".build-link")).to have_content(build.id)
expect(page.find(".build-link")).not_to have_content(build1.id)
expect(page.find(".build-link")).not_to have_content(build2.id)
expect(page.find(".build-link")).not_to have_content(build3.id)
end
 
it "shows running builds" do
Loading
Loading
@@ -62,10 +62,10 @@ describe "Admin Builds" do
click_on "Running"
end
 
page.find(".build-link").should have_content(build1.id)
page.find(".build-link").should_not have_content(build.id)
page.find(".build-link").should_not have_content(build2.id)
page.find(".build-link").should_not have_content(build3.id)
expect(page.find(".build-link")).to have_content(build1.id)
expect(page.find(".build-link")).not_to have_content(build.id)
expect(page.find(".build-link")).not_to have_content(build2.id)
expect(page.find(".build-link")).not_to have_content(build3.id)
end
end
end
require 'spec_helper'
 
describe "Admin Events" do
describe "Admin Events", feature: true do
let(:event) { FactoryGirl.create :admin_event }
before do
Loading
Loading
@@ -14,7 +14,7 @@ describe "Admin Events" do
visit admin_events_path
end
 
it { page.should have_content "Events" }
it { page.should have_content event.description }
it { expect(page).to have_content "Events" }
it { expect(page).to have_content event.description }
end
end
require 'spec_helper'
 
describe "Admin Projects" do
describe "Admin Projects", feature: true do
let(:project) { FactoryGirl.create :project }
 
before do
Loading
Loading
@@ -14,6 +14,6 @@ describe "Admin Projects" do
visit admin_projects_path
end
 
it { page.should have_content "Projects" }
it { expect(page).to have_content "Projects" }
end
end
require 'spec_helper'
 
describe "Admin Runners" do
describe "Admin Runners", feature: true do
before do
skip_admin_auth
login_as :user
Loading
Loading
@@ -27,8 +27,8 @@ describe "Admin Runners" do
click_button 'Search'
end
 
it { page.should have_content("foo") }
it { page.should_not have_content("bar") }
it { expect(page).to have_content("foo") }
it { expect(page).not_to have_content("bar") }
end
end
 
Loading
Loading
@@ -42,12 +42,12 @@ describe "Admin Runners" do
end
 
describe 'runner info' do
it { find_field('runner_token').value.should eq runner.token }
it { expect(find_field('runner_token').value).to eq runner.token }
end
 
describe 'projects' do
it { page.should have_content("foo") }
it { page.should have_content("bar") }
it { expect(page).to have_content("foo") }
it { expect(page).to have_content("bar") }
end
 
describe 'search' do
Loading
Loading
@@ -56,8 +56,8 @@ describe "Admin Runners" do
click_button 'Search'
end
 
it { page.should have_content("foo") }
it { page.should_not have_content("bar") }
it { expect(page).to have_content("foo") }
it { expect(page).not_to have_content("bar") }
end
end
end
require 'spec_helper'
 
describe "Builds" do
describe "Builds", feature: true do
before do
@project = FactoryGirl.create :project
@commit = FactoryGirl.create :commit, project: @project
Loading
Loading
@@ -13,9 +13,9 @@ describe "Builds" do
visit project_build_path(@project, @build)
end
 
it { page.should have_content @commit.sha[0..7] }
it { page.should have_content @commit.git_commit_message }
it { page.should have_content @commit.git_author_name }
it { expect(page).to have_content @commit.sha[0..7] }
it { expect(page).to have_content @commit.git_commit_message }
it { expect(page).to have_content @commit.git_author_name }
end
 
describe "GET /:project/builds/:id/cancel" do
Loading
Loading
@@ -25,8 +25,8 @@ describe "Builds" do
visit cancel_project_build_path(@project, @build)
end
 
it { page.should have_content 'canceled' }
it { page.should have_content 'Retry' }
it { expect(page).to have_content 'canceled' }
it { expect(page).to have_content 'Retry' }
end
 
describe "POST /:project/builds/:id/retry" do
Loading
Loading
@@ -37,8 +37,8 @@ describe "Builds" do
click_link 'Retry'
end
 
it { page.should have_content 'pending' }
it { page.should have_content 'Cancel' }
it { expect(page).to have_content 'pending' }
it { expect(page).to have_content 'Cancel' }
end
 
describe "Show page public accessible" do
Loading
Loading
@@ -52,6 +52,6 @@ describe "Builds" do
visit project_build_path(@project, @build)
end
 
it { page.should have_content @commit.sha[0..7] }
it { expect(page).to have_content @commit.sha[0..7] }
end
end
require 'spec_helper'
 
describe "Commits" do
describe "Commits", feature: true do
context "Authenticated user" do
before do
login_as :user
Loading
Loading
@@ -14,9 +14,9 @@ describe "Commits" do
visit project_ref_commit_path(@project, @commit.ref, @commit.sha)
end
 
it { page.should have_content @commit.sha[0..7] }
it { page.should have_content @commit.git_commit_message }
it { page.should have_content @commit.git_author_name }
it { expect(page).to have_content @commit.sha[0..7] }
it { expect(page).to have_content @commit.git_commit_message }
it { expect(page).to have_content @commit.git_author_name }
end
 
describe "Cancel commit" do
Loading
Loading
@@ -24,7 +24,7 @@ describe "Commits" do
visit project_ref_commit_path(@project, @commit.ref, @commit.sha)
click_on "Cancel"
 
page.should have_content "canceled"
expect(page).to have_content "canceled"
end
end
 
Loading
Loading
@@ -32,7 +32,7 @@ describe "Commits" do
it "does not show warning" do
visit project_ref_commit_path(@project, @commit.ref, @commit.sha)
 
page.should_not have_content ".gitlab-ci.yml not found in this commit"
expect(page).not_to have_content ".gitlab-ci.yml not found in this commit"
end
 
it "shows warning" do
Loading
Loading
@@ -41,7 +41,7 @@ describe "Commits" do
 
visit project_ref_commit_path(@project, @commit.ref, @commit.sha)
 
page.should have_content ".gitlab-ci.yml not found in this commit"
expect(page).to have_content ".gitlab-ci.yml not found in this commit"
end
end
end
Loading
Loading
@@ -58,9 +58,9 @@ describe "Commits" do
visit project_ref_commit_path(@project, @commit.ref, @commit.sha)
end
 
it { page.should have_content @commit.sha[0..7] }
it { page.should have_content @commit.git_commit_message }
it { page.should have_content @commit.git_author_name }
it { expect(page).to have_content @commit.sha[0..7] }
it { expect(page).to have_content @commit.git_commit_message }
it { expect(page).to have_content @commit.git_author_name }
end
end
end
require 'spec_helper'
 
describe "Events" do
describe "Events", feature: true do
let(:project) { FactoryGirl.create :project }
let(:event) { FactoryGirl.create :admin_event, project: project }
Loading
Loading
@@ -14,7 +14,7 @@ describe "Events" do
visit project_events_path(project)
end
 
it { page.should have_content "Events" }
it { page.should have_content event.description }
it { expect(page).to have_content "Events" }
it { expect(page).to have_content event.description }
end
end
require 'spec_helper'
 
describe "Lint" do
describe "Lint", feature: true do
before do
login_as :user
end
Loading
Loading
@@ -11,10 +11,10 @@ describe "Lint" do
fill_in "content", with: content
click_on "Validate"
within "table" do
page.should have_content("Job - rspec")
page.should have_content("Job - spinach")
page.should have_content("Deploy Job - staging")
page.should have_content("Deploy Job - production")
expect(page).to have_content("Job - rspec")
expect(page).to have_content("Job - spinach")
expect(page).to have_content("Deploy Job - staging")
expect(page).to have_content("Deploy Job - production")
end
end
 
Loading
Loading
@@ -22,7 +22,7 @@ describe "Lint" do
visit lint_path
fill_in "content", with: ""
click_on "Validate"
page.should have_content("Status: syntax is incorrect")
page.should have_content("Error: Please provide content of .gitlab-ci.yml")
expect(page).to have_content("Status: syntax is incorrect")
expect(page).to have_content("Error: Please provide content of .gitlab-ci.yml")
end
end
require 'spec_helper'
 
describe "Projects" do
describe "Projects", feature: true do
before do
login_as :user
@project = FactoryGirl.create :project, name: "GitLab / gitlab-shell"
Loading
Loading
@@ -12,8 +12,8 @@ describe "Projects" do
visit projects_path
end
 
it { page.should have_content "GitLab / gitlab-shell" }
it { page.should have_selector ".search input#search" }
it { expect(page).to have_content "GitLab / gitlab-shell" }
it { expect(page).to have_selector ".search input#search" }
end
 
describe "GET /projects/:id" do
Loading
Loading
@@ -21,8 +21,8 @@ describe "Projects" do
visit project_path(@project)
end
 
it { page.should have_content @project.name }
it { page.should have_content 'All commits' }
it { expect(page).to have_content @project.name }
it { expect(page).to have_content 'All commits' }
end
 
describe "GET /projects/:id/edit" do
Loading
Loading
@@ -30,16 +30,16 @@ describe "Projects" do
visit edit_project_path(@project)
end
 
it { page.should have_content @project.name }
it { page.should have_content 'Build Schedule' }
it { expect(page).to have_content @project.name }
it { expect(page).to have_content 'Build Schedule' }
 
it "updates configuration" do
fill_in 'Timeout', with: '70'
click_button 'Save changes'
 
page.should have_content 'was successfully updated'
expect(page).to have_content 'was successfully updated'
 
find_field('Timeout').value.should eq '70'
expect(find_field('Timeout').value).to eq '70'
end
end
 
Loading
Loading
@@ -48,10 +48,10 @@ describe "Projects" do
visit project_charts_path(@project)
end
 
it { page.should have_content 'Overall' }
it { page.should have_content 'Builds chart for last week' }
it { page.should have_content 'Builds chart for last month' }
it { page.should have_content 'Builds chart for last year' }
it { page.should have_content 'Commit duration in minutes for last 30 commits' }
it { expect(page).to have_content 'Overall' }
it { expect(page).to have_content 'Builds chart for last week' }
it { expect(page).to have_content 'Builds chart for last month' }
it { expect(page).to have_content 'Builds chart for last year' }
it { expect(page).to have_content 'Commit duration in minutes for last 30 commits' }
end
end
require 'spec_helper'
 
describe "Runners" do
describe "Runners", feature: true do
before do
login_as :user
end
Loading
Loading
@@ -12,7 +12,7 @@ describe "Runners" do
stub_js_gitlab_calls
 
# all projects should be authorized for user
Network.any_instance.stub(:projects).and_return([
allow_any_instance_of(Network).to receive(:projects).and_return([
OpenStruct.new({id: @project.gitlab_id}),
OpenStruct.new({id: @project2.gitlab_id})
])
Loading
Loading
@@ -26,9 +26,9 @@ describe "Runners" do
 
it "places runners in right places" do
visit project_runners_path(@project)
page.find(".available-specific-runners").should have_content(@specific_runner2.display_name)
page.find(".activated-specific-runners").should have_content(@specific_runner.display_name)
page.find(".available-shared-runners").should have_content(@shared_runner.display_name)
expect(page.find(".available-specific-runners")).to have_content(@specific_runner2.display_name)
expect(page.find(".activated-specific-runners")).to have_content(@specific_runner.display_name)
expect(page.find(".available-shared-runners")).to have_content(@shared_runner.display_name)
end
 
it "enables specific runner for project" do
Loading
Loading
@@ -38,7 +38,7 @@ describe "Runners" do
click_on "Enable for this project"
end
 
page.find(".activated-specific-runners").should have_content(@specific_runner2.display_name)
expect(page.find(".activated-specific-runners")).to have_content(@specific_runner2.display_name)
end
 
it "disables specific runner for project" do
Loading
Loading
@@ -50,7 +50,7 @@ describe "Runners" do
click_on "Disable for this project"
end
 
page.find(".available-specific-runners").should have_content(@specific_runner.display_name)
expect(page.find(".available-specific-runners")).to have_content(@specific_runner.display_name)
end
 
it "removes specific runner for project if this is last project for that runners" do
Loading
Loading
@@ -60,7 +60,7 @@ describe "Runners" do
click_on "Remove runner"
end
 
Runner.exists?(id: @specific_runner).should be_false
expect(Runner.exists?(id: @specific_runner)).to be_falsey
end
end
 
Loading
Loading
@@ -75,7 +75,7 @@ describe "Runners" do
 
click_on "Enable shared runners"
 
@project.reload.shared_runners_enabled.should be_true
expect(@project.reload.shared_runners_enabled).to be_truthy
end
end
 
Loading
Loading
@@ -92,7 +92,7 @@ describe "Runners" do
 
click_on @specific_runner.short_sha
 
page.should have_content(@specific_runner.platform)
expect(page).to have_content(@specific_runner.platform)
end
end
end
require 'spec_helper'
 
describe 'Variables' do
describe 'Variables', feature: true do
before do
login_as :user
@project = FactoryGirl.create :project
Loading
Loading
@@ -11,16 +11,16 @@ describe 'Variables' do
context 'create a trigger' do
before do
click_on 'Add Trigger'
@project.triggers.count.should == 1
expect(@project.triggers.count).to eq 1
end
 
it 'contains trigger token' do
page.should have_content(@project.triggers.first.token)
expect(page).to have_content(@project.triggers.first.token)
end
 
it 'revokes the trigger' do
click_on 'Revoke'
@project.triggers.count.should == 0
expect(@project.triggers.count).to eq 0
end
end
end
require 'spec_helper'
 
describe "Variables" do
describe "Variables", feature: true do
before do
login_as :user
end
Loading
Loading
@@ -18,8 +18,8 @@ describe "Variables" do
fill_in "Value", with: "SECRET_VALUE"
click_on "Save changes"
page.should have_content("Variables were successfully updated.")
@project.variables.count.should == 1
expect(page).to have_content("Variables were successfully updated.")
expect(@project.variables.count).to eq 1
end
 
end
Loading
Loading
Loading
Loading
@@ -11,12 +11,12 @@ describe ApplicationHelper do
}
 
intervals_in_words.each do |interval, expectation|
duration_in_words(Time.now + interval, Time.now).should == expectation
expect(duration_in_words(Time.now + interval, Time.now)).to eq expectation
end
end
 
it "calculates interval from now if there is no finished_at" do
duration_in_words(nil, Time.now - 5).should == "5 seconds"
expect(duration_in_words(nil, Time.now - 5)).to eq "5 seconds"
end
end
 
Loading
Loading
@@ -30,7 +30,7 @@ describe ApplicationHelper do
}
 
intervals_in_words.each do |interval, expectation|
time_interval_in_words(interval).should == expectation
expect(time_interval_in_words(interval)).to eq expectation
end
end
end
Loading
Loading
Loading
Loading
@@ -3,16 +3,16 @@ require 'spec_helper'
describe RunnersHelper do
it "returns - not contacted yet" do
runner = FactoryGirl.build :runner
runner_status_icon(runner).should include("not connected yet")
expect(runner_status_icon(runner)).to include("not connected yet")
end
 
it "returns offline text" do
runner = FactoryGirl.build(:runner, contacted_at: 1.day.ago, active: true)
runner_status_icon(runner).should include("Runner is offline")
expect(runner_status_icon(runner)).to include("Runner is offline")
end
 
it "returns online text" do
runner = FactoryGirl.build(:runner, contacted_at: 1.hour.ago, active: true)
runner_status_icon(runner).should include("Runner is online")
expect(runner_status_icon(runner)).to include("Runner is online")
end
end
require 'spec_helper'
 
describe UserHelper do
describe :user_avatar_url do
describe 'user_avatar_url' do
let (:user) { User.new({'avatar_url' => avatar_url}) }
 
context 'no avatar' do
let (:avatar_url) { nil }
 
it 'should return a generic avatar' do
user_avatar_url(user).should == 'no_avatar.png'
expect(user_avatar_url(user)).to eq 'no_avatar.png'
end
end
 
Loading
Loading
@@ -17,11 +17,11 @@ describe UserHelper do
let (:avatar_url) { "#{base_url}?s=40&d=mm" }
 
it 'should return gravatar with default size' do
user_avatar_url(user).should == "#{base_url}?s=40&d=identicon"
expect(user_avatar_url(user)).to eq "#{base_url}?s=40&d=identicon"
end
 
it 'should return gravatar with custom size' do
user_avatar_url(user, 120).should == "#{base_url}?s=120&d=identicon"
expect(user_avatar_url(user, 120)).to eq "#{base_url}?s=120&d=identicon"
end
end
 
Loading
Loading
@@ -30,11 +30,11 @@ describe UserHelper do
let (:avatar_url) { "#{base_url}?s=40&d=mm" }
 
it 'should return gravatar with default size' do
user_avatar_url(user).should == "#{base_url}?s=40&d=identicon"
expect(user_avatar_url(user)).to eq "#{base_url}?s=40&d=identicon"
end
 
it 'should return gravatar with custom size' do
user_avatar_url(user, 120).should == "#{base_url}?s=120&d=identicon"
expect(user_avatar_url(user, 120)).to eq "#{base_url}?s=120&d=identicon"
end
end
 
Loading
Loading
@@ -42,7 +42,7 @@ describe UserHelper do
let (:avatar_url) { 'http://example.local/avatar.png' }
 
it 'should return custom avatar' do
user_avatar_url(user).should == avatar_url
expect(user_avatar_url(user)).to eq avatar_url
end
end
end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment