<commit_before>RSpec.describe RsvpsController, type: :controller do
  let!(:user) { create(:user) }
  let!(:location) { create(:location) }
  let!(:team) { user.teams.create!(name: "DBC", activity: "soccer",  home_location: location) }
  let!(:membership) {user.memberships.create!(team: team)}

  before(:each) do
    allow_any_instance_of(MembershipsController).to receive(:current_user).and_return(user)
  end

  context "UPDATE rsvps#update" do
    it 'to change rsvp from pending to attending' do
      expect(membership.paid).to be false
      # expect{
      #   put :mark_paid, { membership_id: membership.id, team_id: team.id } }.to change{membership.paid}.from(false).to(true)
      expect(
        put :mark_paid, { membership_id: membership.id, team_id: team.id } ).to redirect_to team_roster_path(membership.team)
    end
  end

end<commit_msg>changes to the rsvp test<commit_after>RSpec.describe RsvpsController, type: :controller do
  let!(:user) { create(:user) }
  let!(:location) { create(:location) }
  let!(:team) { user.teams.create!(name: "DBC", activity: "soccer",  home_location: location) }
  let!(:membership) {user.memberships.create!(team: team)}
  let!(:game) { team.games.create(game_time: DateTime.now, location: location) }
  let!(:rsvp) { membership.rsvps.create!(game: game) }

  before(:each) do
    allow_any_instance_of(MembershipsController).to receive(:current_user).and_return(user)
  end

  context "UPDATE rsvps#update" do
    it 'to change rsvp from pending to attending' do
      expect(membership.paid).to be false
      # expect{
      #   put :mark_paid, { membership_id: membership.id, team_id: team.id } }.to change{membership.paid}.from(false).to(true)
      expect(
        put :update, { team_id: team.id, game_id: game.id, id: rsvp.id } ).to render_template('games/show')
    end
  end

end
{'fraction_non_alphanumeric': 0.14270211611502984, 'fraction_numerical': 0.0, 'mean_word_length': 4.3604651162790695, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3004945', 'n_tokens_mistral': 635, 'n_tokens_neox': 622, 'n_words': 136}