Skip to content

Commit

Permalink
Fix RSpec: Add community_id to person
Browse files Browse the repository at this point in the history
  • Loading branch information
rap1ds committed Apr 28, 2016
1 parent 7f85742 commit ae630dd
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions spec/controllers/sessions_controller_spec.rb
Expand Up @@ -3,15 +3,28 @@
describe SessionsController, "POST create", type: :controller do

before(:each) do
community1 = FactoryGirl.create(:community, :consent => "test_consent0.1", :settings => {"locales" => ["en", "fi"]}, :real_name_required => true)
person1 = FactoryGirl.create(:person, :username => "testpersonusername", :is_admin => 0, "locale" => "en", :encrypted_password => "$2a$10$WQHcobA3hrTdSDh1jfiMquuSZpM3rXlcMU71bhE1lejzBa3zN7yY2", :given_name => "Kassi", :family_name => "Testperson1", :phone_number => "0000-123456", :created_at => "2012-05-04 18:17:04")
community1 = FactoryGirl.create(:community,
consent: "test_consent0.1",
settings: {"locales" => ["en", "fi"]},
real_name_required: true)

FactoryGirl.create(:community_membership, :person => person1,
:community => community1,
:admin => 1,
:consent => "test_consent0.1",
:last_page_load_date => DateTime.now,
:status => "accepted" )
person1 = FactoryGirl.create(:person,
username: "testpersonusername",
is_admin: 0, "locale" => "en",
encrypted_password: "$2a$10$WQHcobA3hrTdSDh1jfiMquuSZpM3rXlcMU71bhE1lejzBa3zN7yY2",
given_name: "Kassi",
family_name: "Testperson1",
phone_number: "0000-123456",
created_at: "2012-05-04 18:17:04",
community_id: community1.id)

FactoryGirl.create(:community_membership,
person: person1,
community: community1,
admin: 1,
consent: "test_consent0.1",
last_page_load_date: DateTime.now,
status: "accepted" )

@request.host = "#{community1.ident}.lvh.me"
end
Expand Down

0 comments on commit ae630dd

Please sign in to comment.