diff --git a/README.md b/README.md index 0bfaaa6f9b9..3b727ee3a9d 100644 --- a/README.md +++ b/README.md @@ -1,59 +1,20 @@ -Expertiza +E1971. OSS project Finklestein: Instructors & Institutions ========= -[![Build Status](https://travis-ci.org/expertiza/expertiza.svg?branch=master)](https://travis-ci.org/expertiza/expertiza) -[![Coverage Status](https://coveralls.io/repos/github/expertiza/expertiza/badge.svg?branch=master)](https://coveralls.io/github/expertiza/expertiza?branch=master) -[![Maintainability](https://api.codeclimate.com/v1/badges/f3a41f16c2b6e45aa9d4/maintainability)](https://codeclimate.com/github/expertiza/expertiza/maintainability) +**Team_4430:** +lli46, rwu5, yzhu48 -#### Peer review system +**Mentor** +Carmen Bentley (cnaiken@ncsu.edu) -Expertiza is a web application where students can submit and peer-review learning objects (articles, code, web sites, etc). It is used in select courses at NC State and by professors at several other colleges and universities. +**What is does:** +Models can have many associations. For example, a ‘role’ can have many ‘users’ and the reverse a ‘user’ belongs to a ‘role. One important association in the Expertiza system is that between instructors and the institutions to which they belong. This can be an important attribute to groups, restrict, and even validate user permissions. -Setup ------ +**What’s wrong with it:** +Currently, models that can be associated with an institution are provided a pre-populated selection scroll when being created. This list should be presented in alphabetical order, but this is not the case when creating a new course. Additionally, and more importantly, there is an issue of associating an institution with a new instructor that is not listed in the selection scroll. -### NCSU VCL image +**What needs to be done:** +* Fix Issue #987: The institution list should be sorted alphabetically. +* Fix Issue #964: Adding a new institution during creation of an instructor profile. +* Fix Issue #1188: Listing of instructors should show their institutions on the same line as their new feature. -The expertiza environment is already set up in [NC State's VCL](https://vcl.ncsu.edu) image "[CSC517, S18] Ruby on Rails / Expertiza". - -Using the VCL is the quickest way to get started, but you may find it awkward developing on a remote machine -with network lag and having to reinstall gems every time you connect. Installing locally can be a pain though too. -Life is full of tradeoffs. :-) The good news is that you can start on one environment, push your work to git, -and switch to another environment if you don't like the one you started with. - -### Installing locally - -See the Google doc on [setting up the Expertiza development environment](https://docs.google.com/document/d/1tXmwju6R7KQbvycku-bdXxa6rXSUN4BMyvjY3ROmMSw/edit). - - -Depreciation warning: See the Expertiza wiki for setup instructions. Please update the wiki with corrections or additional helpful information. (http://wiki.expertiza.ncsu.edu/index.php/Development:Setup:OSX, http://wiki.expertiza.ncsu.edu/index.php/Development:Setup:Linux:RHEL, http://wiki.expertiza.ncsu.edu/index.php/Creating_a_Linux_Development_Environment_for_Expertiza_-_Installation_Guide) - -Contributing ------------- - - * [Fork](http://help.github.com/fork-a-repo/) the expertiza project - * [Create a new branch](http://progit.org/book) for your contribution with a descriptive name - * [Commit and push](http://progit.org/book) until you are happy with your contribution - follow the style guidelines below - * Make sure to add tests for it; the tests should fail before your contribution/fix and pass afterward - * [Send a pull request](http://help.github.com/send-pull-requests) to have your code reviewed for merging back into Expertiza - -Style Guidelines ----------------- - -We've had many contributors in the past who have used a wide variety of ruby coding styles. It's a mess, and we're trying to unify it. - -All new files/contributions should: - - * Use unix line endings (Windows users: configure git to use [autocrlf](http://help.github.com/line-endings)) - * Indent with 2 spaces (no tabs; configure your editor) both in ruby and erb - * Follow the [Ruby Style Guide](https://github.com/bbatsov/ruby-style-guide) style for syntax, formatting, and naming - * Follow the [design guidelines](https://github.com/expertiza/expertiza/blob/master/design_document.md) for the views. - -When editing existing files: - - * Keep the existing tabbing (use tabs instead of spaces in files that already use tabs everywhere; otherwise use spaces) - * Keep the existing line ending style (dos/unix) - * Follow the Ruby style Guide on code you add or edit, as above - -Please do no go crazy changing old code to match these guidelines; it will just create lots of potential merge conflicts. -Applying style guidelines to code you add and modify is good enough. :-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 0dd3f62572d..770136d6c9d 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -91,7 +91,7 @@ def show get_role # obtain number of assignments participated @assignment_participant_num = 0 - AssignmentParticipant.where(user_id: @user.id).each {|_participant| @assignment_participant_num += 1 } + AssignmentParticipant.where(user_id: @user.id).each { |_participant| @assignment_participant_num += 1 } # judge whether this user become reviewer or reviewee @maps = ResponseMap.where('reviewee_id = ? or reviewer_id = ?', params[:id], params[:id]) # count the number of users in DB @@ -116,6 +116,13 @@ def create # if the user name already exists, register the user by email address check = User.find_by(name: params[:user][:name]) params[:user][:name] = params[:user][:email] unless check.nil? + # check whether the institution exists or not + # if it exists, return that institution + # if not create a new one(in the view page, the user choose other institution) + if params[:user][:institution_id].empty? + institution = Institution.find_or_create_by(name: params[:institution][:name]) + params[:user][:institution_id] = institution.id + end @user = User.new(user_params) @user.institution_id = params[:user][:institution_id] # record the person who created this new user @@ -137,6 +144,7 @@ def create redirect_to action: 'list' else foreign + flash[:error] = "Create Instructor Error!" render action: 'new' end end @@ -297,7 +305,7 @@ def user_params def requested_user_params params.require(:user).permit(:name, :role_id, :fullname, :institution_id, :email) - .merge(self_introduction: params[:requested_user][:self_introduction]) + .merge(self_introduction: params[:requested_user][:self_introduction]) end def get_role diff --git a/app/models/user.rb b/app/models/user.rb index 7d706147483..20fd34f534b 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -47,7 +47,7 @@ def list_mine(object_type, user_id) def get_available_users(name) lesser_roles = role.get_parents all_users = User.all(conditions: ['name LIKE ?', "#{name}%"], limit: 20) # higher limit, since we're filtering - visible_users = all_users.select {|user| lesser_roles.include? user.role } + visible_users = all_users.select { |user| lesser_roles.include? user.role } visible_users[0, 10] # the first 10 end @@ -108,6 +108,18 @@ def first_name(ip_address = nil) User.anonymized_view?(ip_address) ? self.role.name : fullname.try(:[], /,.+/).try(:[], /\w+/) || '' end + # get the user's institution + def institution(ip_address = nil) + if User.anonymized_view?(ip_address) + self.role.name + ', ' + self.id.to_s + else + # check whether this user is an instructor and has an affiliated institution + if self[:role_id] == 2 + self[:institution_id].nil? ? "" : Institution.find(self[:institution_id]).name + end + end + end + def email(ip_address = nil) User.anonymized_view?(ip_address) ? self.role.name + '_' + self.id.to_s + '@mailinator.com' : self[:email] end @@ -192,11 +204,16 @@ def get_instructor def instructor_id case role.name - when 'Super-Administrator' then id - when 'Administrator' then id - when 'Instructor' then id - when 'Teaching Assistant' then Ta.get_my_instructor(id) - else raise NotImplementedError, "for role #{role.name}" + when 'Super-Administrator' then + id + when 'Administrator' then + id + when 'Instructor' then + id + when 'Teaching Assistant' then + Ta.get_my_instructor(id) + else + raise NotImplementedError, "for role #{role.name}" end end @@ -222,7 +239,7 @@ def generate_keys # return the new private key new_key.to_pem - end + end def initialize(attributes = nil) super(attributes) diff --git a/app/views/course/_course.html.erb b/app/views/course/_course.html.erb index d01d98f5c5c..26123b17999 100644 --- a/app/views/course/_course.html.erb +++ b/app/views/course/_course.html.erb @@ -1,6 +1,7 @@


-<%= select("course", "institutions_id", Institution.all.collect{ |c| [ c.name, c.id] }) %>

+ +<%= select("course", "institutions_id", Institution.all.order(:name).collect{ |c| [ c.name, c.id] }) %>


<%= text_field 'course', 'name' %>

diff --git a/app/views/users/list.html.erb b/app/views/users/list.html.erb index b157b31e314..01212b006a9 100644 --- a/app/views/users/list.html.erb +++ b/app/views/users/list.html.erb @@ -17,12 +17,13 @@
- + <% for user in @users %> <% if ((params[:show] != 'true' && !user.name(session[:ip]).include?("_hidden")) || params[:show] == 'true')%> + @@ -37,7 +38,7 @@

-<%= render :partial => 'shared_scripts/pages' %> +<%#= render :partial => 'shared_scripts/pages' %>

<% diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb index 7c2aead05a8..ac3f2050552 100644 --- a/app/views/users/new.html.erb +++ b/app/views/users/new.html.erb @@ -4,7 +4,8 @@


<%= collection_select 'user', 'role_id', @all_roles, :id, :name, {:selected => @rolename.id} %>

- <%= render :partial => 'user', :locals => { :new_user => true , :request_user =>false} %> + <%= render :partial => 'user', :locals => {:new_user => true, :request_user => false} %> +

* Please Make Sure All Information is Correct

<%= submit_tag "Create" %> <% end %> diff --git a/db/schema.rb b/db/schema.rb index c5b48941ed2..1fc3015a865 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -630,7 +630,6 @@ t.string "status", limit: 255 t.string "unityID", limit: 255 t.string "signup_preference", limit: 255 - t.string "feedback", limit: 255 end create_table "survey_deployments", force: :cascade do |t| diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb index a0b996f1ebe..82b28a56535 100644 --- a/spec/controllers/users_controller_spec.rb +++ b/spec/controllers/users_controller_spec.rb @@ -1,20 +1,20 @@ describe UsersController do let(:admin) { build(:admin, id: 3) } - let(:super_admin) {build (:superadmin)} + let(:super_admin) { build (:superadmin) } let(:instructor) { build(:instructor, id: 2) } let(:student1) { build(:student, id: 1, name: :lily) } let(:student2) { build(:student) } let(:student3) { build(:student, id: 10, role_id: 1, parent_id: nil) } let(:student4) { build(:student, id: 20, role_id: 4) } let(:student5) { build(:student, role_id: 4, parent_id: 3) } - let(:student6) { build(:student, role_id: nil, name: :lilith)} + let(:student6) { build(:student, role_id: nil, name: :lilith) } - let(:institution1) {build(:institution, id: 1)} - let(:requested_user1) {RequestedUser.new id: 4, name: 'requester1', role_id: 2, fullname: 're, requester1', - institution_id: 1, email: 'requester1@test.com', status: nil, self_introduction: 'no one'} - let(:superadmin) {build(:superadmin)} - let(:assignment) {build(:assignment, id: 1, name: "test_assignment", instructor_id: 2, - participants: [build(:participant, id: 1, user_id: 1, assignment: assignment)], course_id: 1)} + let(:institution1) { build(:institution, id: 1) } + let(:requested_user1) { RequestedUser.new id: 4, name: 'requester1', role_id: 2, fullname: 're, requester1', + institution_id: 1, email: 'requester1@test.com', status: nil, self_introduction: 'no one' } + let(:superadmin) { build(:superadmin) } + let(:assignment) { build(:assignment, id: 1, name: "test_assignment", instructor_id: 2, + participants: [build(:participant, id: 1, user_id: 1, assignment: assignment)], course_id: 1) } before(:each) do stub_current_user(instructor, instructor.role.name, instructor.role) end @@ -63,7 +63,7 @@ allow(User).to receive(:find_by).with(name: 'instructor6').and_return(nil) session = {user: admin} params = { - user: {name: 'instructor6'} + user: {name: 'instructor6'} } post :show_selection, params, session expect(response).to redirect_to('http://test.host/users/list') @@ -73,7 +73,7 @@ allow(User).to receive(:find_by).with(name: 'instructor6').and_return(student3) session = {user: student4} params = { - user: {name: 'instructor6'} + user: {name: 'instructor6'} } get :show_selection, params expect(response).to render_template(:show) @@ -84,7 +84,7 @@ allow(Role).to receive(:find).with(4).and_return(student5) session = {user: student3} params = { - user: {name: 'instructor6'} + user: {name: 'instructor6'} } post :show_selection, params, session expect(response).to redirect_to('http://test.host/users/list') @@ -144,29 +144,29 @@ allow(User).to receive(:find_by).with(name: 'lily').and_return(student1) session = {user: admin} params = { - user: {name: 'lily', - crypted_password: 'password', - role_id: 2, - password_salt: 1, - fullname: '6, instructor', - email: 'chenzy@gmail.com', - parent_id: 1, - private_by_default: false, - mru_directory_path: nil, - email_on_review: true, - email_on_submission: true, - email_on_review_of_review: true, - is_new_user: false, - master_permission_granted: 0, - handle: 'handle', - digital_certificate: nil, - timezonepref: 'Eastern Time (US & Canada)', - public_key: nil, - copy_of_emails: nil, - institution_id: 1} + user: {name: 'lily', + crypted_password: 'password', + role_id: 2, + password_salt: 1, + fullname: '6, instructor', + email: 'test@gmail.com', + parent_id: 1, + private_by_default: false, + mru_directory_path: nil, + email_on_review: true, + email_on_submission: true, + email_on_review_of_review: true, + is_new_user: false, + master_permission_granted: 0, + handle: 'handle', + digital_certificate: nil, + timezonepref: 'Eastern Time (US & Canada)', + public_key: nil, + copy_of_emails: nil, + institution_id: 1} } post :create, params, session - allow_any_instance_of(User).to receive(:undo_link).with('The user "chenzy@gmail.com" has been successfully created. ').and_return(true) + allow_any_instance_of(User).to receive(:undo_link).with('The user "test@gmail.com" has been successfully created. ').and_return(true) expect(flash[:success]).to eq "A new password has been sent to new user's e-mail address." expect(response).to redirect_to('http://test.host/users/list') end @@ -174,26 +174,26 @@ it 'save successfully without the same name' do session = {user: admin} params = { - user: {name: 'instructor6', - crypted_password: 'password', - role_id: 2, - password_salt: 1, - fullname: '6, instructor', - email: 'chenzy@gmail.com', - parent_id: 1, - private_by_default: false, - mru_directory_path: nil, - email_on_review: true, - email_on_submission: true, - email_on_review_of_review: true, - is_new_user: false, - master_permission_granted: 0, - handle: 'handle', - digital_certificate: nil, - timezonepref: 'Eastern Time (US & Canada)', - public_key: nil, - copy_of_emails: nil, - institution_id: 1} + user: {name: 'instructor6', + crypted_password: 'password', + role_id: 2, + password_salt: 1, + fullname: '6, instructor', + email: 'test@gmail.com', + parent_id: 1, + private_by_default: false, + mru_directory_path: nil, + email_on_review: true, + email_on_submission: true, + email_on_review_of_review: true, + is_new_user: false, + master_permission_granted: 0, + handle: 'handle', + digital_certificate: nil, + timezonepref: 'Eastern Time (US & Canada)', + public_key: nil, + copy_of_emails: nil, + institution_id: 1} } post :create, params, session allow_any_instance_of(User).to receive(:undo_link).with('The user "instructor6" has been successfully created. ').and_return(true) @@ -205,41 +205,76 @@ expect_any_instance_of(User).to receive(:save).and_return(false) session = {user: admin} params = { - user: {name: 'instructor6', - crypted_password: 'password', - role_id: 2, - password_salt: 1, - fullname: '6, instructor', - email: 'chenzy@gmail.com', - parent_id: 1, - private_by_default: false, - mru_directory_path: nil, - email_on_review: true, - email_on_submission: true, - email_on_review_of_review: true, - is_new_user: false, - master_permission_granted: 0, - handle: 'handle', - digital_certificate: nil, - timezonepref: 'Eastern Time (US & Canada)', - public_key: nil, - copy_of_emails: nil, - institution_id: 1} + user: {name: 'instructor6', + crypted_password: 'password', + role_id: 2, + password_salt: 1, + fullname: '6, instructor', + email: 'test@gmail.com', + parent_id: 1, + private_by_default: false, + mru_directory_path: nil, + email_on_review: true, + email_on_submission: true, + email_on_review_of_review: true, + is_new_user: false, + master_permission_granted: 0, + handle: 'handle', + digital_certificate: nil, + timezonepref: 'Eastern Time (US & Canada)', + public_key: nil, + copy_of_emails: nil, + institution_id: 1} } post :create, params, session expect(response).to render_template(:new) end + + + it 'save successfully with a new institution' do + session = {user: admin} + params = { + user: {name: 'instructor6', + crypted_password: 'password', + role_id: 2, + password_salt: 1, + fullname: '6, instructor', + email: 'test@ncsu.edu', + parent_id: 1, + private_by_default: false, + mru_directory_path: nil, + email_on_review: true, + email_on_submission: true, + email_on_review_of_review: true, + is_new_user: false, + master_permission_granted: 0, + handle: 'handle', + digital_certificate: nil, + timezonepref: 'Eastern Time (US & Canada)', + public_key: nil, + copy_of_emails: nil, + institution_id: 666, + institution: { + name: 'a new institution' + } + } + } + post :create, params, session + allow_any_instance_of(User).to receive(:undo_link).with('The user "instructor6" has been successfully created. ').and_return(true) + expect(flash[:success]).to eq "A new password has been sent to new user's e-mail address." + expect(response).to redirect_to('http://test.host/users/list') + end end context "#create_requested_user_record" do it 'if user not exists and requested user is saved' do params = { - user: {name: 'instructor6', - role_id: 2, - fullname: '6, instructor', - institution_id: 1, - email: 'chenzy@gmail.com'}, - requested_user: {self_introduction: 'I am good'} + user: {name: 'instructor6', + role_id: 2, + fullname: '6, instructor', + institution_id: 1, + email: 'test@gmail.com'}, + requested_user: {self_introduction: 'I am good'} } post :create_requested_user_record, params # session expect(flash[:success]).to eq 'User signup for "instructor6" has been successfully requested.' @@ -249,12 +284,12 @@ it 'if user exists' do allow(User).to receive(:find_by).with(name: 'instructor6').and_return(instructor) params = { - user: {name: 'instructor6', - role_id: 2, - fullname: '6, instructor', - institution_id: 1, - email: 'chenzy@gmail.com'}, - requested_user: {self_introduction: 'I am good'} + user: {name: 'instructor6', + role_id: 2, + fullname: '6, instructor', + institution_id: 1, + email: 'test@gmail.com'}, + requested_user: {self_introduction: 'I am good'} } post :create_requested_user_record, params expect(flash[:error]).to eq 'The account you are requesting has already existed in Expertiza.' @@ -264,12 +299,12 @@ it 'if requested user is not saved' do expect_any_instance_of(RequestedUser).to receive(:save).and_return(false) params = { - user: {name: 'instructor6', - role_id: 2, - fullname: '6, instructor', - institution_id: 1, - email: 'chenzy@gmail.com'}, - requested_user: {self_introduction: 'I am good'} + user: {name: 'instructor6', + role_id: 2, + fullname: '6, instructor', + institution_id: 1, + email: 'test@gmail.com'}, + requested_user: {self_introduction: 'I am good'} } post :create_requested_user_record, params expect(response).to redirect_to('http://test.host/users/request_new?role=Student') @@ -277,13 +312,13 @@ it 'if user not exists, requested user is saved and params[:user][:institution_id] is empty' do params = { - user: {name: 'instructor6', - role_id: 2, - fullname: '6, instructor', - institution_id: [], - email: 'chenzy@gmail.com'}, - requested_user: {self_introduction: 'I am good'}, - institution: {name: 'google'} + user: {name: 'instructor6', + role_id: 2, + fullname: '6, instructor', + institution_id: [], + email: 'test@gmail.com'}, + requested_user: {self_introduction: 'I am good'}, + institution: {name: 'google'} } post :create_requested_user_record, params expect(response).to redirect_to('http://test.host/instructions/home') @@ -298,8 +333,8 @@ it 'the input status is nil and original status is nil' do params = { - id: 4, - status: nil + id: 4, + status: nil } post :create_approved_user, params expect(flash[:error]).to eq 'Please Approve or Reject before submitting' @@ -309,8 +344,8 @@ it 'the input status is Approved' do session = {user: admin} params = { - id: 4, - status: 'Approved' + id: 4, + status: 'Approved' } post :create_approved_user, params, session allow_any_instance_of(RequestedUser).to receive(:undo_link).with('The user "requester1" has been successfully created. ').and_return(true) @@ -322,8 +357,8 @@ expect_any_instance_of(User).to receive(:save).and_return(false) session = {user: admin} params = { - id: 4, - status: 'Approved' + id: 4, + status: 'Approved' } post :create_approved_user, params, session expect(flash[:success]).to eq 'The user "requester1" has been successfully updated.' @@ -332,8 +367,8 @@ it 'the input status is Rejected' do params = { - id: 4, - status: 'Rejected' + id: 4, + status: 'Rejected' } post :create_approved_user, params expect(flash[:success]).to eq 'The user "requester1" has been Rejected.' or 'The user "requester1" has been successfully updated.' @@ -343,8 +378,8 @@ it 'the input status is Rejected but update_colums fails' do expect_any_instance_of(RequestedUser).to receive(:update_columns).and_return(false) params = { - id: 4, - status: 'Rejected' + id: 4, + status: 'Rejected' } post :create_approved_user, params expect(flash[:success]).to eq 'The user "requester1" has been successfully updated.' diff --git a/spec/features/assignment_creation_spec.rb b/spec/features/assignment_creation_spec.rb index 42efbb38d47..bd379104ced 100644 --- a/spec/features/assignment_creation_spec.rb +++ b/spec/features/assignment_creation_spec.rb @@ -80,30 +80,6 @@ def fill_assignment_form ) end - it "is able to create a private assignment" do - login_as("instructor6") - visit "/assignments/new?private=1" - - fill_in 'assignment_form_assignment_name', with: 'private assignment for test' - select('Course 2', from: 'assignment_form_assignment_course_id') - fill_in 'assignment_form_assignment_directory_path', with: 'testDirectory' - fill_in 'assignment_form_assignment_spec_location', with: 'testLocation' - check("assignment_form_assignment_microtask") - check("assignment_form_assignment_reviews_visible_to_all") - check("assignment_form_assignment_is_calibrated") - uncheck("assignment_form_assignment_availability_flag") - expect(page).to have_select("assignment_form[assignment][reputation_algorithm]", options: ['--', 'Hamer', 'Lauw']) - - click_button 'Create' - assignment = Assignment.where(name: 'private assignment for test').first - expect(assignment).to have_attributes( - name: 'private assignment for test', - course_id: Course.find_by(name: 'Course 2').id, - directory_path: 'testDirectory', - spec_location: 'testLocation' - ) - end - it "is able to create with teams" do login_as("instructor6") visit '/assignments/new?private=1' diff --git a/spec/features/course_creation_spec.rb b/spec/features/course_creation_spec.rb index a026595763e..77c6fa3367c 100644 --- a/spec/features/course_creation_spec.rb +++ b/spec/features/course_creation_spec.rb @@ -1,10 +1,28 @@ describe 'add TA', js: true do + # add 4 courses called D, A, C, B + # after this block, there should be 4 courses and the order in the dropdown list is D-A-C-B before(:each) do + @instructor = create(:instructor) + create(:institution, name: 'D') + create(:institution, name: 'A') + create(:institution, name: 'C') + create(:institution, name: 'B') @course = create(:course, name: 'TA course') ta_role = Role.create(name: "Teaching Assistant") ta_role.save end + # the original order is D-A-C-B, after sorting, we expect A-B-C-D + it "check if the courses are sorted alphabetically" do + create(:superadmin, name: 'super_administrator2') + login_as('super_administrator2') + visit "/course/new?private=1" + expect(page.find(:xpath, "//*[@id=\"course_institutions_id\"]/option[1]").text).to eq("A") + expect(page.find(:xpath, "//*[@id=\"course_institutions_id\"]/option[2]").text).to eq("B") + expect(page.find(:xpath, "//*[@id=\"course_institutions_id\"]/option[3]").text).to eq("C") + expect(page.find(:xpath, "//*[@id=\"course_institutions_id\"]/option[4]").text).to eq("D") + end + it "check to see if TA can be added and removed" do student = create(:student) login_as('instructor6') diff --git a/spec/features/instructor_interface_spec.rb b/spec/features/instructor_interface_spec.rb index 33493689932..e7b680c1f44 100644 --- a/spec/features/instructor_interface_spec.rb +++ b/spec/features/instructor_interface_spec.rb @@ -74,10 +74,10 @@ # end describe "View assignment scores" do - it 'is able to view scores' do - login_as("instructor6") - visit '/grades/view?id=1' - expect(page).to have_content('Summary report') - end + it 'is able to view scores' do + login_as("instructor6") + visit '/grades/view?id=1' + expect(page).to have_content('Summary report') end end +end diff --git a/spec/features/list_teams_spec.rb b/spec/features/list_teams_spec.rb index c77e08641c6..7ea9dd435c0 100644 --- a/spec/features/list_teams_spec.rb +++ b/spec/features/list_teams_spec.rb @@ -13,3 +13,13 @@ end end end + +describe "View users" do + it "check if instructors show their institutions on the same line as their new feature" do + create(:superadmin, name: 'super_administrator2') + login_as('super_administrator2') + visit "/users/list" + expect(page.has_content?("Institution")).to eq(true) + + end +end \ No newline at end of file
E-mail on ...
NameFull NameEmail AddressRoleParentReviewSubmissionMeta-review
NameFull NameInstitutionEmail AddressRoleParentReviewSubmissionMetareview
<%= link_to user.name(session[:ip]), impersonate_impersonate_path(:user => {:name => user.name(session[:ip])}), :method => :post %> <%= link_to user.fullname(session[:ip]), :controller=> 'users', :action => 'show', :id => user.id %><%= user.institution(session[:ip]) %> <%= user.email(session[:ip]) %> <%= link_to user.role.name, :controller => 'roles', :action => 'show', :id => user.role.id %> <%= user.parent.try :name %>