-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #583 from sparc-request/saw-dashboard-history-add-…
…changed-by-column SAW - dashboard history add changed by column
- Loading branch information
Showing
15 changed files
with
187 additions
and
5 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
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,6 @@ | ||
class AddChangedByToPastStatuses < ActiveRecord::Migration | ||
def change | ||
add_column :past_statuses, :changed_by_id, :integer | ||
add_index :past_statuses, :changed_by_id | ||
end | ||
end |
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
48 changes: 48 additions & 0 deletions
48
spec/controllers/service_requests_controller/get_obtain_research_pricing_spec.rb
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,48 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.describe ServiceRequestsController do | ||
|
||
describe 'GET obtain_research_pricing' | ||
stub_controller | ||
|
||
let_there_be_lane | ||
let_there_be_j | ||
|
||
before :each do | ||
session[:identity_id] = jug2.id | ||
@protocol = create(:study_without_validations, | ||
primary_pi: jug2) | ||
@organization = create(:provider) | ||
@service_request = create(:service_request_without_validations, | ||
status: 'draft', | ||
protocol: @protocol) | ||
@sub_service_request = create(:sub_service_request, | ||
service_request_id: @service_request.id, | ||
status: 'draft', | ||
organization_id: @organization.id) | ||
end | ||
|
||
context 'Editing a sub_service_request' do | ||
it 'Should create a past_status for the sub_service_request' do | ||
xhr :get, :obtain_research_pricing, | ||
id: @service_request.id, | ||
sub_service_request_id: @sub_service_request.id | ||
|
||
ps = PastStatus.find_by(sub_service_request_id: @sub_service_request.id) | ||
|
||
expect(ps.status).to eq('draft') | ||
end | ||
end | ||
|
||
context 'Editing a service_request' do | ||
it 'Should create a past_status for the sub_service_request' do | ||
xhr :get, :obtain_research_pricing, | ||
id: @service_request.id | ||
|
||
ps = PastStatus.find_by(sub_service_request_id: @sub_service_request.id) | ||
|
||
expect(ps.status).to eq('draft') | ||
end | ||
end | ||
|
||
end |
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