Skip to content

Commit

Permalink
fix tests & lint
Browse files Browse the repository at this point in the history
  • Loading branch information
jhackett1 committed Aug 25, 2022
1 parent 435b24a commit 2074e99
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/models/sponsors_search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ def by_name
end

def by_chapter
@sponsors = sponsors.joins(:workshops).where("workshops.chapter_id" => chapter) if chapter.present?
@sponsors = sponsors.joins(:workshops).where('workshops.chapter_id' => chapter) if chapter.present?
end
end
6 changes: 3 additions & 3 deletions spec/models/sponsors_search_spec.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
require 'spec_helper'

RSpec.describe SponsorsSearch, type: :model do
let(:search_params) { { per_page: 5, page: 2, name: Faker::Name.name } }
let(:search_params) { { per_page: 5, page: 2, name: Faker::Name.name, chapter: Faker::Name.name } }

describe 'initialization params' do
it 'configures its properties using the param hash' do
params = { per_page: 5, page: 2, name: Faker::Name.name }
params = { per_page: 5, page: 2, name: Faker::Name.name, chapter: Faker::Name.name }

sponsors_search = described_class.new(search_params)

Expand All @@ -25,7 +25,7 @@
it 'returns all sponsors when no filter is specified' do
expect(Sponsor).to_not receive(:by_name)

described_class.new({ name: nil}).call
described_class.new({ name: nil, chapter: nil}).call
end
end
end

0 comments on commit 2074e99

Please sign in to comment.