Skip to content

Commit

Permalink
Adjust tests to new role model.
Browse files Browse the repository at this point in the history
  • Loading branch information
cmfcmf committed Nov 17, 2016
1 parent d07aa48 commit 24083ec
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 6 deletions.
3 changes: 0 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,5 @@ DEPENDENCIES
twitter-bootstrap-rails
web-console (~> 2.0)

RUBY VERSION
ruby 2.2.2p95

BUNDLED WITH
1.13.6
2 changes: 1 addition & 1 deletion app/models/profile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ class Profile < ActiveRecord::Base
belongs_to :user

validates :user, presence: true
validates_presence_of :first_name, :last_name, :gender, :birth_date, :email, :school, :street_name, :zip_code, :city, :state, :country, on: :update
validates_presence_of :first_name, :last_name, :gender, :birth_date, :email, :school, :street_name, :zip_code, :city, :state, :country

end
2 changes: 1 addition & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20161114195923) do
ActiveRecord::Schema.define(version: 20161116092838) do

create_table "application_letters", force: :cascade do |t|
t.string "motivation"
Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/profiles_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# adjust the attributes here as well.
let(:valid_attributes) { FactoryGirl.build(:profile).attributes }

let(:invalid_attributes) { FactoryGirl.build(:profile, user: nil).attributes } #TODO: we need another required field for a profile
let(:invalid_attributes) { FactoryGirl.build(:profile, school: nil).attributes }

# This should return the minimal set of values that should be in the session
# in order to pass any filters (e.g. authentication) defined in
Expand Down
1 change: 1 addition & 0 deletions spec/features/profile_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
RSpec.feature "Profile adaptation", :type => :feature do
scenario "user leaves out required fields" do
@profile = FactoryGirl.create(:profile)
login_as(@profile.user, :scope => :user)
visit edit_profile_path(@profile)
fill_in "profile_first_name", with: ""
fill_in "profile_last_name", with: "Doe"
Expand Down

0 comments on commit 24083ec

Please sign in to comment.