-
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
Simon Tinsley #2118
base: main
Are you sure you want to change the base?
Simon Tinsley #2118
Conversation
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.
Simon, I really like your project. The presentation is clean and elegant, it works well and playing it is fun and behaves as expected. The CSS styling is a great addition. The specific test fail can be moved forward to a new failing test (:grimacing:) by using click_link "Rock" instead of click_button "Rock". The capybara documentation is not super helpful to be honest in this area, and I've been struggling on the same. I used find_by_id("Rock").click in mine - but I'm not sure that works - clink link on yours seemed to move it forward. More comments in the review on GH
"Sorry, you lose! You picked scissors and the computer picked rock." | ||
end | ||
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.
I like how simple this is to follow - it's a nice way to have implemented the logic - nice work.
<a href="/paper"><button id="paper">Paper</button></a> | ||
<a href="/scissors"><button id="scissors">Scissors</button></a> | ||
</div> | ||
</body> |
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.
Lovely work - elegant routing and selfishly it answers the question I was stuck on. Nice
h1 {font-size: 48px; margin-bottom: 16px;} | ||
.container {max-width: 1200px; text-align: center; background-color: #fff; margin: 40px auto 0 auto; padding: 20px; border-radius: 10px} | ||
button {background-color: #072a6c; color: #fff; border-radius: 10px; padding: 10px 30px; margin: 10px; border: 0} | ||
p {margin-bottom: 16px;} |
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.
Dude - this is a triumph of simple elegant styling - nice work
scenario "I select rock and I'm told I've won" do | ||
allow_any_instance_of(Game).to receive(:name).and_return(2) | ||
enter_name | ||
click_button "Rock" |
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 problem with these tests is in how you are clicking the buttons. My understanding is that Cabybara will only find a click form button with this syntax. Instead try click_link("Rock")
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.
However I put that in and theres a new problem, but at least we're kicking down the TDD path...
…k from here - thanks to Gawain for finding the previous problem
No description provided.