forked from wearefriday/spectre
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
32be450
commit c3bf7ac
Showing
6 changed files
with
38 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
FactoryGirl.define do | ||
factory :project do | ||
name 'spec_project' | ||
end | ||
|
||
factory :suite do | ||
name 'spec_suite' | ||
project | ||
end | ||
|
||
factory :run do | ||
suite | ||
end | ||
|
||
factory :test do | ||
name 'rspec_test' | ||
browser 'na' | ||
platform 'na' | ||
size '0' | ||
run | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,11 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.describe Test do | ||
it 'flags if the tests has failed more than five consecutive times' do | ||
project = Project.create!(name: 'spec_project') | ||
suite = project.suites.create!(name: 'spec_suite') | ||
run = suite.runs.create! | ||
test_params = { | ||
name: 'rspec_test', | ||
browser: 'na', | ||
platform: 'na', | ||
size: '0' | ||
} | ||
5.times do | ||
run.tests.create!(test_params) | ||
FactoryGirl.create(:test) | ||
end | ||
test = run.tests.create!(test_params) | ||
test = FactoryGirl.create(:test) | ||
expect(test.five_consecutive_failures).to eq true | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
RSpec.configure do |config| | ||
config.include FactoryGirl::Syntax::Methods | ||
end |