-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'flexibus/#379/teams-page-design' of https://github.com/…
…hpi-swt2/sport-portal into flexibus/#379/teams-page-design
- Loading branch information
Showing
11 changed files
with
146 additions
and
133 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
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,10 +1,5 @@ | ||
FactoryBot.define do | ||
factory :tournament, parent: :event, traits: [:has_dates], class: Tournament do | ||
game_mode :ko | ||
|
||
factory :tournament_with_teams, class: Tournament, parent: :event_with_teams, traits: [:has_dates] do | ||
teams_count 4 | ||
game_mode :ko | ||
end | ||
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
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,44 @@ | ||
shared_examples 'an actual event' do |for_class: :event| | ||
let(:event) { FactoryBot.build(for_class) } | ||
it 'should not validate without selection_type' do | ||
event.selection_type = nil | ||
expect(event.valid?).to eq(false) | ||
end | ||
|
||
it 'should have an attribute deadline' do | ||
date = Date.tomorrow | ||
expect(event.deadline).to eq date | ||
|
||
event.deadline = nil | ||
expect(event).not_to be_valid | ||
end | ||
|
||
it 'should have an attribute startdate' do | ||
date = Date.current + 2 | ||
expect(event.startdate).to eq date | ||
|
||
expect(event).to be_valid | ||
event.startdate = nil | ||
expect(event).not_to be_valid | ||
end | ||
|
||
it 'should have an attribute enddate' do | ||
date = Date.current + 3 | ||
expect(event.enddate).to eq date | ||
|
||
expect(event).to be_valid | ||
event.enddate = nil | ||
expect(event).not_to be_valid | ||
end | ||
|
||
it 'should not be possible to have an enddate, that is before the startdate' do | ||
expect(event).to be_valid | ||
event.enddate = Date.current | ||
event.startdate = Date.current + 1 | ||
expect(event).not_to be_valid | ||
end | ||
|
||
it 'should be possible to get the duration in day of a event' do | ||
expect(event.duration).to eq(2) | ||
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
Oops, something went wrong.