-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kieran's RPS Challenge #2114
base: main
Are you sure you want to change the base?
Kieran's RPS Challenge #2114
Conversation
end | ||
|
||
|
||
class Game |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the Game class should be separate from the app.rb file
when 3 | ||
choice = "scissors" | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it could be achieved with less code:
[:rock, :paper, :scissors].sample
require "capybara/rspec" | ||
require_relative "../../app" | ||
|
||
Capybara.app = RPS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the above is needed in the feature test spec
visit("/name") | ||
expect(page).to have_button('submit') | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the above is not testing for the choice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good division into controller and view, although controller needs to be further separated into model (and controller). The app behaves as expected. Some features tests are included, unit tests are missing.
I managed to get my app working but need to add more feature and unit tests although I'm not sure on the rspec syntax how to write them. Also, I think the app could have better functionality by allowing user to click on buttons rather than type to submit their move.
I need help with testing and more knowledge on html to improve I think.