Skip to content

Stevie Spiegl RPS - #2115

Open
S-Spiegl wants to merge 62 commits into
makersacademy:mainfrom
S-Spiegl:main
Open

Stevie Spiegl RPS#2115
S-Spiegl wants to merge 62 commits into
makersacademy:mainfrom
S-Spiegl:main

Conversation

@S-Spiegl

@S-Spiegl S-Spiegl commented May 9, 2022

Copy link
Copy Markdown

No description provided.

Comment thread views/play.erb Outdated
@@ -23,7 +23,6 @@ border='2' name='player_choice' type='submit' id='paper'></>
<input type="hidden" name="player_choice" value="paper" />

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Don't forget to indent everything! Makes it easier to read for others ;) Maybe even have blank lines between the parts that don't relate i.e. After each form to show where one stops and the other starts (this is only when you know a code review will be done)

Comment thread views/form.erb Outdated
<form action='/play' method='post'>
<input type="text" name="player" style="padding: 5px 15px"><br><br>
<button type="submit" style="padding: 5px 10px">Submit name!</button>
</form>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Indentation.. naughty naughty!

Comment thread views/battle.erb
<form action='/play_again' method='post'>
<button type="submit" style="padding: 5px 10px">Have another go?</button>
</form>
</body>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Same again. Takes maybe a day or two to write the code, but people would have to read it an unspecified amount of time

Comment thread spec/player_spec.rb Outdated
@@ -5,7 +5,4 @@
it "should return player's name" do

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

much better indentation here. Clear class names and tests. Nice one man!

Comment thread spec/game_spec.rb Outdated
end
xit 'taunts the player if they lose' do
end
end

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Empty file? I think you left the spec for this somewhere else? Then maybe you could delete this file

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Perhaps it would be good to consider what you might have tested in here if you had the time - you could even comment some ideas and come back to it at a later stage when you want to make improvements, especially the logic in Game is an important one.

sign_in
click_on(id='scissors')
expect(page).to have_content "You chose wisely."
end

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Really clear test scenarios, really enjoyed reading these if I'm honest. Good takeaway for my tests in the future, thank you!

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Agreed, good testing, well done for using stubs effectively here

sign_in
expect(current_path).to eq('/play')
expect(page).to have_content('Alien')
end

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Clear, concise, good indentation

Comment thread app.rb

# Start the server if this file is executed directly (don't change the line below)
run! if app_file == $0
end

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Great file, concise, good use of class names and instance and global variables

@z-rasool z-rasool left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Overall good file structure, use of stubs and identification of which objects to create. It would have been good to see some unit tests for Game, and perhaps something you can come to if you get the time in the future! Well done Stevie.

Comment thread lib/game.rb
elsif @player_weapon == :paper && @computer_weapon == :scissors
"You did not choose wisely."
end
end

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good to see the creation of a WEAPONS constant in this file. Could the engine method be refactored to reduce repetition - perhaps the use of a hash?

sign_in
click_on(id='scissors')
expect(page).to have_content "You chose wisely."
end

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Agreed, good testing, well done for using stubs effectively here

Comment thread spec/game_spec.rb Outdated
end
xit 'taunts the player if they lose' do
end
end

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Perhaps it would be good to consider what you might have tested in here if you had the time - you could even comment some ideas and come back to it at a later stage when you want to make improvements, especially the logic in Game is an important one.

Comment thread lib/player.rb
def select_weapon(weapon)
@weapon = weapon
end

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Could the WEAPONS constant be used in this file too?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants