Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
guidojw committed Oct 14, 2023
1 parent f6377e9 commit 1ccb7a1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
10 changes: 0 additions & 10 deletions app/resources/v1/application_resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,18 @@ class V1::ApplicationResource < JSONAPI::Resource

filter :search

# :nocov:
def self.creatable_fields(_context)
[]
end

# :nocov:

def self.updatable_fields(context)
creatable_fields(context)
end

# :nocov:
def self.searchable_fields
[]
end

# :nocov:

def self.apply_filter(records, filter, value, options)
# Monkeypatch for weird bug in filter method
# When defining a filter on application level
Expand Down Expand Up @@ -79,10 +73,6 @@ def current_user
context.fetch(:user)
end

def current_application
context.fetch(:application)
end

def self.current_user_or_application(options)
options.fetch(:context).fetch(:user) || options.fetch(:context).fetch(:application)
end
Expand Down
5 changes: 3 additions & 2 deletions spec/resources/v1/activity_resource_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@
end

describe 'sort' do
let(:sorted) { described_class.apply_sort(Activity, options, context) }
let(:sorted) { described_class.apply_sort(records, sort, context) }

describe 'form.respond_until' do
let(:sort) { { form: { respond_until: :desc } } }
let(:records) { Activity.all }
let(:sort) { { 'form.respond_until' => :desc } }
let(:form) { create(:form, respond_until: 1.day.from_now) }
let(:other_form) { create(:form, respond_until: 2.days.from_now) }
let(:activity) { create(:activity, form: form) }
Expand Down

0 comments on commit 1ccb7a1

Please sign in to comment.