<commit_before>require 'rails_helper'

describe UsersController do
  describe "GET #new" do
    it "responds with status code 200" do
      get :new
      expect(response).to have_http_status 200
    end

    it "renders the :new template" do
      get :new
      expect(response).to render_template(:new)
    end
  end

  describe "POST #create" do
    context "when valid params are passed" do
      it "responds with status code 302" do
        post :create, { user: { username: "username", email: "<EMAIL>", password: "password", password_confirmation: "password" }}
        expect(response).to have_http_status 302
      end

      it "creates a new user in the database" do
        expect { post :create, { user: { username: "username", email: "<EMAIL>", password: "password", password_confirmation: "password" }} }.to change(User, :count).by(1)
      end
    end

    context "when invalid params are passed" do
      it "renders the :new template again" do
        post :create, { user: { username: "username", email: "<EMAIL>", password: "password", password_confirmation: "password" }}
        expect(response).to render_template(:new)
      end
    end
  end
end
<commit_msg>Fix test to be properly testing invalid params<commit_after>require 'rails_helper'

describe UsersController do
  describe "GET #new" do
    it "responds with status code 200" do
      get :new
      expect(response).to have_http_status 200
    end

    it "renders the :new template" do
      get :new
      expect(response).to render_template(:new)
    end
  end

  describe "POST #create" do
    context "when valid params are passed" do
      it "responds with status code 302" do
        post :create, { user: { username: "username", email: "<EMAIL>", password: "password", password_confirmation: "password" }}
        expect(response).to have_http_status 302
      end

      it "creates a new user in the database" do
        expect { post :create, { user: { username: "username", email: "<EMAIL>", password: "password", password_confirmation: "password" }} }.to change(User, :count).by(1)
      end
    end

    context "when invalid params are passed" do
      it "renders the :new template again" do
        post :create, { user: { username: "username", email: ""}}
        expect(response).to render_template(:new)
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.10598290598290598, 'fraction_numerical': 0.011111111111111112, 'mean_word_length': 3.0855148342059335, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, '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': '6070369', 'n_tokens_mistral': 700, 'n_tokens_neox': 663, 'n_words': 250}