Skip to content

Conversation

simon-2357
Copy link

No description provided.

Copy link

@gawainhewitt gawainhewitt left a 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

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> No newline at end of file

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;} No newline at end of file

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"

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")

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
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.

2 participants