mumuki-laboratory 7.0.9 → 7.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d4d336ad84b2c7da871c2d197b57744ae45e798b637340bff530045c9077d720
4
- data.tar.gz: 94191df5d2841b0465efbcbbbc5e3c60a54e52987b4f1bb280289324c0d79b27
3
+ metadata.gz: 6349a7c55b93be1880845776c5c017c104db3dc26bf627dd94c671851fe9eb14
4
+ data.tar.gz: 2ef2f62bd6d8cbe828e890fe8e98d3afd629b2b5818ad35bc39454a4de7ed3b8
5
5
  SHA512:
6
- metadata.gz: 862002b05967676245a1dcf3ad992fb9fc8923bda4075019be80d58d9d16131f5df1c5bc2d6e306a4e72ddb4ddaa7ddc3b25b835a9e2d6f2a36057cff3e72643
7
- data.tar.gz: abc1bb8c4fb6607aff0fe3f89dbea8dd1c676b71b6450b25a83179f8c211619ca240acfaf2ddfa39f060f01e9a89bea205ccd6db82ca26f35532b2266616a224
6
+ metadata.gz: d4f007aa20177f56d32d0a5c826edaf4ff21460725254fce5c659c70af869bd36e2e3a524a1b1dafead2efd59cdaddbdae155d5f11df3913865ec19ade0349dd
7
+ data.tar.gz: '039ca9904728e320b6d6064d2ad3f239d00265b7a115e3c551aa1d5f34ef2000fccf49ca3058a8aa262dc2ed27174d4e7e5bd9ff5b1b1a0fbc14916efdcba024'
@@ -1,4 +1,6 @@
1
1
  class InvitationsController < ApplicationController
2
+ include WithUserParams
3
+
2
4
  before_action :authenticate!
3
5
  before_action :set_invitation!
4
6
  before_action :set_user!
@@ -23,8 +25,8 @@ class InvitationsController < ApplicationController
23
25
  redirect_to Mumukit::Platform.laboratory.organic_url(@organization)
24
26
  end
25
27
 
26
- def user_params
27
- params.require(:user).permit(:name, :first_name, :last_name, :email)
28
+ def permissible_params
29
+ super + [:email, :name]
28
30
  end
29
31
 
30
32
  def set_invitation!
@@ -1,5 +1,5 @@
1
1
  module Mumuki
2
2
  module Laboratory
3
- VERSION = '7.0.9'
3
+ VERSION = '7.0.10'
4
4
  end
5
5
  end
@@ -0,0 +1,26 @@
1
+ require 'spec_helper'
2
+
3
+ describe InvitationsController, type: :controller, organization_workspace: :test do
4
+ let(:user) { create(:user) }
5
+
6
+ before { set_current_user! user }
7
+
8
+ describe 'when invitation does not exist' do
9
+ before { get :join, params: {code: 'foo123' } }
10
+
11
+ it { expect(response.status).to eq 404 }
12
+ end
13
+
14
+ describe 'when invitation exists' do
15
+ let(:organization) { Organization.current }
16
+ let(:course) { create(:course, slug: 'test/foo-1111', name: 'Generic Course', organization: organization) }
17
+ let!(:invitation) { create(:invitation, code: 'foo123', course: course ) }
18
+
19
+ before { get :join, params: {code: 'foo123', user: {first_name: 'new first_name', gender: 'female'} } }
20
+ before { user.reload }
21
+
22
+ it { expect(response.status).to eq 302 }
23
+ it { expect(user.first_name).to eq 'new first_name' }
24
+ it { expect(user.gender).to eq 'female' }
25
+ end
26
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mumuki-laboratory
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.9
4
+ version: 7.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franco Bulgarelli
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-23 00:00:00.000000000 Z
11
+ date: 2019-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -484,6 +484,7 @@ files:
484
484
  - spec/controllers/discussions_controller_spec.rb
485
485
  - spec/controllers/exercise_solutions_controller_spec.rb
486
486
  - spec/controllers/guide_progress_controller_spec.rb
487
+ - spec/controllers/invitations_controller_spec.rb
487
488
  - spec/controllers/messages_controller_spec.rb
488
489
  - spec/controllers/organizations_api_controller_spec.rb
489
490
  - spec/controllers/students_api_controller_spec.rb
@@ -710,6 +711,7 @@ test_files:
710
711
  - spec/controllers/courses_api_controller_spec.rb
711
712
  - spec/controllers/confirmations_controller_spec.rb
712
713
  - spec/controllers/api_clients_controller.rb
714
+ - spec/controllers/invitations_controller_spec.rb
713
715
  - spec/controllers/users_api_controller_spec.rb
714
716
  - spec/controllers/guide_progress_controller_spec.rb
715
717
  - spec/controllers/organizations_api_controller_spec.rb