-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove leading and trailing whitespace from filters
- Loading branch information
1 parent
681ca9f
commit 7df5a33
Showing
3 changed files
with
67 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,40 @@ | |
|
||
it { is_expected.to contain_exactly(included) } | ||
end | ||
|
||
context "with trailing whitespace" do | ||
let(:params) { { email: "[email protected] " } } | ||
let(:scope) { ApplicationForm.all } | ||
let!(:included) { create(:application_form, teacher:) } | ||
|
||
before do | ||
create( | ||
:application_form, | ||
teacher: create(:teacher, email: "[email protected]"), | ||
) | ||
end | ||
|
||
it "returns a filtered scope" do | ||
expect(subject).to contain_exactly(included) | ||
end | ||
end | ||
|
||
context "with leading whitespace" do | ||
let(:params) { { email: " [email protected]" } } | ||
let(:scope) { ApplicationForm.all } | ||
let!(:included) { create(:application_form, teacher:) } | ||
|
||
before do | ||
create( | ||
:application_form, | ||
teacher: create(:teacher, email: "[email protected]"), | ||
) | ||
end | ||
|
||
it "returns a filtered scope" do | ||
expect(subject).to contain_exactly(included) | ||
end | ||
end | ||
end | ||
|
||
context "the params don't include email" do | ||
|