This repository has been archived by the owner on Sep 25, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/development' into Deploy
- Loading branch information
Showing
25 changed files
with
204 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,6 @@ LineLength: | |
|
||
java_script: | ||
enabled: true | ||
|
||
scss: | ||
enabled: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
require 'rails_helper' | ||
|
||
describe 'Course specific name', type: :feature do | ||
let!(:lecturer) { FactoryGirl.create(:lecturer) } | ||
let!(:student) { FactoryGirl.create(:student) } | ||
let!(:course) { FactoryGirl.create(:course, :with_student, creator: lecturer, student: student) } | ||
let!(:user_course) { student.get_user_course(course) } | ||
|
||
context 'when name change is allowed' do | ||
before { Course.any_instance.stub(:allow_name_change?).and_return(true) } | ||
|
||
context 'when change name in user profile' do | ||
let(:new_name) { 'New Name' } | ||
|
||
before do | ||
sign_in student | ||
visit users_settings_path | ||
fill_in 'user_name', with: new_name | ||
click_button 'Update' | ||
end | ||
|
||
it 'changes name in course' do | ||
expect(user_course.reload.name).to eq new_name | ||
end | ||
end | ||
|
||
context 'when change name in course' do | ||
let(:new_name) { 'New Name' } | ||
|
||
before do | ||
sign_in lecturer | ||
visit course_manage_students_path(course) | ||
fill_in 'name', with: new_name | ||
find(:xpath, '//button[@type="submit"]').click | ||
end | ||
|
||
it 'changes name in course' do | ||
expect(user_course.reload.name).to eq new_name | ||
end | ||
end | ||
end | ||
|
||
context 'when name change is not allowed' do | ||
before { Course.any_instance.stub(:allow_name_change?).and_return(false) } | ||
|
||
context 'when change name in user profile' do | ||
let(:new_name) { 'New Name' } | ||
|
||
before do | ||
sign_in student | ||
visit users_settings_path | ||
fill_in 'user_name', with: new_name | ||
click_button 'Update' | ||
end | ||
|
||
it 'does not change name in course' do | ||
expect(user_course.reload.name).not_to eq new_name | ||
end | ||
end | ||
|
||
context 'when change name in course' do | ||
let(:new_name) { 'New Name' } | ||
|
||
before do | ||
sign_in lecturer | ||
visit course_manage_students_path(course) | ||
fill_in 'name', with: new_name | ||
find(:xpath, '//button[@type="submit"]').click | ||
end | ||
|
||
it 'changes name in course' do | ||
expect(user_course.reload.name).to eq new_name | ||
end | ||
end | ||
end | ||
end |
Oops, something went wrong.