Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Kieran's RPS Challenge #2114

wants to merge 2 commits into from

Conversation

K-Carty
Copy link

@K-Carty K-Carty commented May 9, 2022

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.

end


class Game
Copy link

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
Copy link

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
Copy link

@LGretzk LGretzk May 9, 2022

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

Copy link

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

Copy link

@LGretzk LGretzk left a 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.

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.

None yet

2 participants