Skip to content

[530] Seed script generates draws in each stage - #595

Open
murphy-ariel wants to merge 3 commits into
masterfrom
530_seed_script_draws_in_every_phase
Open

[530] Seed script generates draws in each stage#595
murphy-ariel wants to merge 3 commits into
masterfrom
530_seed_script_draws_in_every_phase

Conversation

@murphy-ariel

Copy link
Copy Markdown
Contributor

Resolves #530

@orenyk

orenyk commented Apr 16, 2017

Copy link
Copy Markdown
Contributor

There are a few rubocop errors that should be resolved before review 😄.

@murphy-ariel

Copy link
Copy Markdown
Contributor Author

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?

@orenyk

orenyk commented Apr 19, 2017

Copy link
Copy Markdown
Contributor

Huh that's really weird. Could you try rebasing onto the latest master?

@murphy-ariel
murphy-ariel force-pushed the 530_seed_script_draws_in_every_phase branch from af0ea11 to bdfe656 Compare April 22, 2017 17:25

@esoterik esoterik left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a few small changes

Comment thread lib/seed/group_generator.rb Outdated

def gen_params(draw:, overrides: {})
size = draw.suite_sizes.sample
members = Array.new(size) do

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can be size.times { UserGenerator.generate(...) }

new(overrides: overrides).generate
end

def initialize(overrides: {}); end

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should call create_draw_params(overrides)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i moved the create_draw_params method to the other generate method

Comment thread lib/seed/lottery_draw_generator.rb Outdated

private

def create_draw_params

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should take overrides as an arg

Comment thread lib/seed/lottery_draw_generator.rb Outdated
suites = Array.new(5) { SuiteGenerator.generate }
suites.each { |s| RoomGenerator.generate(suite: s) }
@params ||= { suites: suites,
name: "#{FFaker::Music.artist} Draw" }

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add .merge(overrides)

Comment thread lib/seed/lottery_draw_generator.rb Outdated
end
end

attr_reader :params

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move this to the top of the private section

def initialize(overrides: {}); end

def generate
LotteryDrawGenerator.generate.tap do |d|

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.generate(overrides: overrides)


private

attr_reader :params

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't need this

Comment thread spec/lib/lottery_draw_generator_spec.rb Outdated
end

it 'makes the draw be in pre-lottery' do
expect(described_class.generate) .to be_lottery

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra space before the .to

end

it 'makes the draw be in pre-lottery' do
expect(described_class.generate) .to be_pre_lottery

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra space before the .to

end

it 'makes the draw be in pre-lottery' do
expect(described_class.generate) .to \

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra space before the .to

@esoterik

Copy link
Copy Markdown
Collaborator

@murphy-ariel add the "needs review" label after you push updates in the future!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants