Sha256: d84170a36d2172004db41e715659f0c50c8d051fb8224f2418ce54d88c5f9362

Contents?: true

Size: 1.97 KB

Versions: 18

Compression:

Stored size: 1.97 KB

Contents

require "rails_helper"

RSpec.describe ::People::V1::User, '.username', :type => :model do
	it "does not save when nil" do
		user = FactoryGirl.build(:people_user_1, :username => nil)
		expect(user.save).to equal(false)
	end
	it "does not save with invalid characters" do
		#user = FactoryGirl.build(:people_user_1, :username => "!@#$%)")
		#expect(user.save).to equal(false)
	end
end
RSpec.describe ::People::V1::User, '.email', :type => :model do
	it "does not save when nil" do
		user = FactoryGirl.build(:people_user_1, :email => nil)
		expect(user.save).to equal(false)
	end
	it "does not save with invalid characters" do
		#user = FactoryGirl.build(:people_user_1, :email => "!@#$%)")
		#expect(user.save).to equal(false)
	end
end
RSpec.describe ::People::V1::User, '.password_digest', :type => :model do
	it "does not save when nil" do
		user = FactoryGirl.build(:people_user_1, :password => nil, :password_confirmation => nil)
		expect(user.save).to equal(false)
	end
	it "does not save when not a match" do
		user = FactoryGirl.build(:people_user_1, :password => "firstAttempt", :password_confirmation => "secondAttempt")
		expect(user.save).to equal(false)
	end
	it "saves with a matching password and password_confirmation" do
		user = FactoryGirl.build(:people_user_1, :password => "good_password", :password_confirmation => "good_password")
		expect(user.save).to equal(true)
	end
end
RSpec.describe ::People::V1::User, :type => :model do
	describe "dependencies" do
		before(:example) do
			@user = FactoryGirl.create(:people_user_1)
		end
		it "deletes ... when deleted" do

		end
	end
end
RSpec.describe ::People::V1::User, :type => :model do
	describe "callbacks" do
		before(:example) do
    	@user = FactoryGirl.create(:people_user_1)
  	end
  	<% if options.arcadex? %>
		it "creates an authentication token" do
			expect(@user.tokens.any?).to equal(true)
		end
		it "does not create an empty auth token" do
			expect(@user.tokens[0].auth_token.nil?).to equal(false)
		end
		<% end %>
	end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
json_voorhees-1.0.0 lib/generators/json_voorhees/app_make_user/templates/user/specs/model_specs.rb
json_voorhees-0.5.5 lib/generators/json_voorhees/app_make_user/templates/user/specs/model_specs.rb
json_voorhees-0.5.4 lib/generators/json_voorhees/app_make_user/templates/user/specs/model_specs.rb
json_voorhees-0.5.3 lib/generators/json_voorhees/app_make_user/templates/user/specs/model_specs.rb
json_voorhees-0.5.2 lib/generators/json_voorhees/app_make_user/templates/user/specs/model_specs.rb
json_voorhees-0.5.1 lib/generators/json_voorhees/app_make_user/templates/user/specs/model_specs.rb
json_voorhees-0.5.0 lib/generators/json_voorhees/app_make_user/templates/user/specs/model_specs.rb
json_voorhees-0.4.9 lib/generators/json_voorhees/app_make_user/templates/user/specs/model_specs.rb
json_voorhees-0.4.8 lib/generators/json_voorhees/app_make_user/templates/user/specs/model_specs.rb
json_voorhees-0.4.7 lib/generators/json_voorhees/app_make_user/templates/user/specs/model_specs.rb
json_voorhees-0.4.6 lib/generators/json_voorhees/app_make_user/templates/user/specs/model_specs.rb
json_voorhees-0.4.5 lib/generators/json_voorhees/app_make_user/templates/user/specs/model_specs.rb
json_voorhees-0.4.4 lib/generators/json_voorhees/app_make_user/templates/user/specs/model_specs.rb
json_voorhees-0.4.3 lib/generators/json_voorhees/app_make_user/templates/user/specs/model_specs.rb
json_voorhees-0.4.2 lib/generators/json_voorhees/app_make_user/templates/user/specs/model_specs.rb
json_voorhees-0.4.1 lib/generators/json_voorhees/app_make_user/templates/user/specs/model_specs.rb
json_voorhees-0.4.0 lib/generators/json_voorhees/app_make_user/templates/user/specs/model_specs.rb
json_voorhees-0.3.9 lib/generators/json_voorhees/app_make_user/templates/user/specs/model_specs.rb