Skip to content

Commit

Permalink
more pr cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
Tooyosi committed Feb 7, 2024
1 parent 121cc3f commit 3107737
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 1 addition & 3 deletions app/controllers/api/v1/project_preferences_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,12 @@ def read_and_update_settings_response
render_json_response
end

private

def set_last_modified_header
response.headers['Last-Modified'] = @upp.updated_at.httpdate
end

def render_json_response
preferences = if action_name == 'update_settings'
if action_name == 'update_settings'
preferences = UserProjectPreference.where(id: @upp.id)
else
preferences = @project.user_project_preference.where.not(email_communication: nil)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@
let(:run_unauthorised_user_read) { get :read_settings, params: { project_id: project.id, user_id: unauthorised_user.id, format: :json } }

describe 'genetic preferences' do
before(:each) do
before do
default_request user_id: authorized_user.id, scopes: scopes
run_generic_read
end
Expand All @@ -218,8 +218,7 @@

it 'returns the correct response data' do
json_response = JSON.parse(response.body)
expect(json_response["project_preferences"]).to be_a(Array)
expect(json_response["project_preferences"].count).to eq(1)
expect(json_response['project_preferences'].count).to eq(1)
end
end

Expand Down

0 comments on commit 3107737

Please sign in to comment.