<commit_before>describe Tok::SessionsController do
  before do
    class User < ActiveRecord::Base
      include Tok::Authentication
    end
  end

  describe "#create" do
    context "with valid credentials" do
      subject { attributes_for(:user) }

      before do
        @user = create(:user)

        post :create, {user: subject}, {"Accept" => "application/json", "Content-Type" => "application/json"}
      end

      it { expect(response).to be_success }
      it { expect(response).to have_http_status :created }
      it { expect(response.body).to eq @user.to_json } 
    end

    context "with invalid credentials" do
      subject { attributes_for(:user) }

      before do
        post :create, {user: subject}, {"Accept" => "application/json", "Content-Type" => "application/json"}<commit_msg>Fix specs<commit_after>describe Tok::SessionsController do
  before do
    class User < ActiveRecord::Base
      include Tok::Authentication
    end
  end

  describe "#create" do
    context "with valid credentials" do
      subject { attributes_for(:user) }

      before do
        @user = create(:user)

        post :create, {user: subject}, {"Accept" => "application/json", "Content-Type" => "application/json"}
      end

      it { expect(response).to be_success }
      it { expect(response).to have_http_status :created }
      it { expect(response.body).to eq ({token: @user.authentication_token}.to_json) } 
    end

    context "with invalid credentials" do
      subject { attributes_for(:user) }

      before do
        post :create, {user: subject}, {"Accept" => "application/json", "Content-Type" => "application/json"}
{'fraction_non_alphanumeric': 0.12393681652490887, 'fraction_numerical': 0.0, 'mean_word_length': 3.0566502463054186, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '5926823', 'n_tokens_mistral': 470, 'n_tokens_neox': 452, 'n_words': 129}