Skip to content

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.

2 participants