Fix tests

This commit is contained in:
Kamil Trzcinski
2016-04-18 07:35:43 -04:00
parent 433ca7390d
commit 28ce41c00e
4 changed files with 28 additions and 27 deletions
+1 -1
View File
@@ -110,7 +110,7 @@ class CommitStatus < ActiveRecord::Base
elsif started_at
Time.now - started_at
end
duration.to_i
duration
end
def stuck?
+1 -1
View File
@@ -13,7 +13,7 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps
end
step 'I should see "Shop" project CI status' do
expect(page).to have_link "Build: skipped"
expect(page).to have_link "Build skipped"
end
step 'I should see last push widget' do
+26 -1
View File
@@ -355,7 +355,8 @@ describe Ci::Commit, models: true do
end
context 'update state' do
let(:build) { FactoryGirl.create :ci_build, :success, commit: commit, started_at: Time.now - 120, finished_at: Time.now - 60 }
let(:current) { Time.now.change(:usec => 0) }
let(:build) { FactoryGirl.create :ci_build, :success, commit: commit, started_at: current - 120, finished_at: current - 60 }
before do
build
@@ -368,4 +369,28 @@ describe Ci::Commit, models: true do
end
end
end
describe '#branch?' do
subject { commit.branch? }
context 'is not a tag' do
before do
commit.tag = false
end
it 'return true when tag is set to false' do
is_expected.to be_truthy
end
end
context 'is not a tag' do
before do
commit.tag = true
end
it 'return false when tag is set to true' do
is_expected.to be_falsey
end
end
end
end
-24
View File
@@ -232,28 +232,4 @@ describe CommitStatus, models: true do
end
end
end
describe '#branch?' do
subject { commit_status.branch? }
context 'is not a tag' do
before do
commit_status.tag = false
end
it 'return true when tag is set to false' do
is_expected.to be_truthy
end
end
context 'is not a tag' do
before do
commit_status.tag = true
end
it 'return false when tag is set to true' do
is_expected.to be_falsey
end
end
end
end