Simon Tinsley - #2118
Conversation
gawainhewitt
left a comment
There was a problem hiding this comment.
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.
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> No newline at end of file |
There was a problem hiding this comment.
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;} No newline at end of file |
There was a problem hiding this comment.
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.
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.
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.