<commit_before>require 'spec_helper'

describe "UsersController" do
  subject { page }
  
  describe "visiting signup_path" do
    before { visit signup_path }
    
    it { should have_button("Create") }
    
    describe "signing up" do
      context "with valid info" do
        pending "creates a new user"
        pending "automatically signs in user"
      end
      
      context "with invalid user info" do
        pending "displays user.errors"
      end #with invalid info<commit_msg>add integration tests for user signup<commit_after>require 'spec_helper'

describe "UsersController" do
  subject { page }
  
  describe "visiting signup_path" do
    before { visit signup_path }
    
    it { should have_field("user_name") }
    it { should have_field("user_email") }
    it { should have_field("user_password") }
    it { should have_field("user_password_confirmation") }
    it { should have_button("Create") }
    
    describe "signing up" do
      before do
        @user = FactoryGirl.build(:user)
        fill_in "user_name", with: @user.name
        fill_in "user_email", with: @user.email
        fill_in "user_password", with: <PASSWORD>
      end
      
      context "with valid info" do
        before do 
          fill_in "user_password_confirmation", with: @user.<PASSWORD>
          click_button "Create"
        end

        it { should have_selector('div.alert.alert-success', text: 'Welcome') }
        it { should have_link('Sign out', href: signout_path) }
      end
      
      context "with invalid user info" do
        before do
          fill_in "user_password_confirmation", with: @user.password_confirmation.<PASSWORD>
          click_button "Create"
        end
        
        it "displays user.errors" do
          it { should have_selector('div.alert.alert-error', text: 'error') }
        end
      end #with invalid info
{'fraction_non_alphanumeric': 0.08823529411764706, 'fraction_numerical': 0.0, 'mean_word_length': 2.4776951672862455, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '3854577', 'n_tokens_mistral': 548, 'n_tokens_neox': 539, 'n_words': 159}