[530] Seed script generates draws in each stage - #595
Conversation
|
There are a few rubocop errors that should be resolved before review 😄. |
|
I'm fairly sure I never touched any of the files that are failing the continuous-integration check - at the next meeting, can someone explain why they are failing tests now? |
|
Huh that's really weird. Could you try rebasing onto the latest master? |
af0ea11 to
bdfe656
Compare
|
|
||
| def gen_params(draw:, overrides: {}) | ||
| size = draw.suite_sizes.sample | ||
| members = Array.new(size) do |
There was a problem hiding this comment.
this can be size.times { UserGenerator.generate(...) }
| new(overrides: overrides).generate | ||
| end | ||
|
|
||
| def initialize(overrides: {}); end |
There was a problem hiding this comment.
this should call create_draw_params(overrides)
There was a problem hiding this comment.
i moved the create_draw_params method to the other generate method
|
|
||
| private | ||
|
|
||
| def create_draw_params |
There was a problem hiding this comment.
should take overrides as an arg
| suites = Array.new(5) { SuiteGenerator.generate } | ||
| suites.each { |s| RoomGenerator.generate(suite: s) } | ||
| @params ||= { suites: suites, | ||
| name: "#{FFaker::Music.artist} Draw" } |
| end | ||
| end | ||
|
|
||
| attr_reader :params |
There was a problem hiding this comment.
move this to the top of the private section
| def initialize(overrides: {}); end | ||
|
|
||
| def generate | ||
| LotteryDrawGenerator.generate.tap do |d| |
There was a problem hiding this comment.
.generate(overrides: overrides)
|
|
||
| private | ||
|
|
||
| attr_reader :params |
| end | ||
|
|
||
| it 'makes the draw be in pre-lottery' do | ||
| expect(described_class.generate) .to be_lottery |
There was a problem hiding this comment.
extra space before the .to
| end | ||
|
|
||
| it 'makes the draw be in pre-lottery' do | ||
| expect(described_class.generate) .to be_pre_lottery |
There was a problem hiding this comment.
extra space before the .to
| end | ||
|
|
||
| it 'makes the draw be in pre-lottery' do | ||
| expect(described_class.generate) .to \ |
There was a problem hiding this comment.
extra space before the .to
|
@murphy-ariel add the "needs review" label after you push updates in the future! |
Resolves #530