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

Student pass all cucumber and rspec tests without setting flash #47

Open
rosewcs345 opened this issue Feb 9, 2018 · 0 comments
Open

Comments

@rosewcs345
Copy link

rosewcs345 commented Feb 9, 2018

Apparently, there are no tests that check to see that the flash is getting set at all (let alone, properly).

If I take a proper solution and substitute this code for the guess method in app.rb, all the tests still pass:

    # Use existing methods in HangpersonGame to process a guess.
    # If a guess is repeated, set flash[:message] to "You have already used that letter."
    # If a guess is invalid, set flash[:message] to "Invalid guess."
    post '/guess' do
      begin
        letter = params[:guess].to_s[0] #this code was given
        #flash[:message] = "You have already used that letter." if ! @game.guess(letter)
        valid = @game.guess(letter)
      rescue ArgumentError
        #flash[:message] = "Invalid guess."
      end
      redirect '/show'
    end
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

No branches or pull requests

1 participant