-
-
Notifications
You must be signed in to change notification settings - Fork 483
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 #6096 from thejonroberts/rspec-rails-setup-re-install
RSpec-Rails Configuration
- Loading branch information
Showing
65 changed files
with
342 additions
and
239 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
--require spec_helper --order random | ||
--require spec_helper |
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 |
---|---|---|
|
@@ -672,4 +672,4 @@ RUBY VERSION | |
ruby 3.2.4p170 | ||
|
||
BUNDLED WITH | ||
2.5.22 | ||
2.5.23 |
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
8 changes: 4 additions & 4 deletions
8
spec/fixtures/casa_cases.csv → spec/fixtures/files/casa_cases.csv
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
case_number,case_assignment,birth_month_year_youth,next_court_date | ||
CINA-01-4347,[email protected], March 2011,Sept 16 2022 | ||
CINA-01-4348,"[email protected], [email protected]",February 2000,Jan 1 2023 | ||
CINA-01-4349,,December 2016, | ||
case_number,case_assignment,birth_month_year_youth,next_court_date | ||
CINA-01-4347,[email protected], March 2011,Sept 16 2022 | ||
CINA-01-4348,"[email protected], [email protected]",February 2000,Jan 1 2023 | ||
CINA-01-4349,,December 2016, |
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
6 changes: 3 additions & 3 deletions
6
spec/fixtures/supervisor_volunteers.csv → .../fixtures/files/supervisor_volunteers.csv
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
email,display_name,supervisor_volunteers,phone_number | ||
[email protected],s5,[email protected],11111111111 | ||
[email protected],s6,[email protected],11111111111 | ||
email,display_name,supervisor_volunteers,phone_number | ||
[email protected],s5,[email protected],11111111111 | ||
[email protected],s6,[email protected],11111111111 |
8 changes: 4 additions & 4 deletions
8
spec/fixtures/supervisors.csv → spec/fixtures/files/supervisors.csv
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
email,display_name,supervisor_volunteers,phone_number | ||
[email protected],Supervisor One,[email protected],11111111111 | ||
[email protected],Supervisor Two,"[email protected], [email protected]",11111111111 | ||
[email protected],Supervisor Three,,11111111111 | ||
email,display_name,supervisor_volunteers,phone_number | ||
[email protected],Supervisor One,[email protected],11111111111 | ||
[email protected],Supervisor Two,"[email protected], [email protected]",11111111111 | ||
[email protected],Supervisor Three,,11111111111 |
File renamed without changes.
6 changes: 3 additions & 3 deletions
6
spec/fixtures/supervisors_without_email.csv → ...tures/files/supervisors_without_email.csv
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
email,display_name,supervisor_volunteers,phone_number | ||
[email protected],Supervisor One,[email protected],11111111111 | ||
,Supervisor Two,"[email protected], [email protected]",11111111111 | ||
email,display_name,supervisor_volunteers,phone_number | ||
[email protected],Supervisor One,[email protected],11111111111 | ||
,Supervisor Two,"[email protected], [email protected]",11111111111 |
File renamed without changes.
8 changes: 4 additions & 4 deletions
8
spec/fixtures/volunteers.csv → spec/fixtures/files/volunteers.csv
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
display_name,email,phone_number | ||
Volunteer One,[email protected],11234567890 | ||
Volunteer Two,[email protected],11234567891 | ||
Volunteer Three,[email protected],11234567892 | ||
display_name,email,phone_number | ||
Volunteer One,[email protected],11234567890 | ||
Volunteer Two,[email protected],11234567891 | ||
Volunteer Three,[email protected],11234567892 |
File renamed without changes.
8 changes: 4 additions & 4 deletions
8
spec/fixtures/volunteers_without_email.csv → ...xtures/files/volunteers_without_email.csv
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
display_name,email,phone_number | ||
Volunteer One,[email protected],11111111111 | ||
Volunteer Two,11111111111 | ||
Volunteer Three,,11111111111 | ||
display_name,email,phone_number | ||
Volunteer One,[email protected],11111111111 | ||
Volunteer Two,11111111111 | ||
Volunteer Three,,11111111111 |
File renamed without changes.
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
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 |
---|---|---|
@@ -1,71 +1,67 @@ | ||
require "rails_helper" | ||
|
||
RSpec.describe PhoneNumberHelper do | ||
describe "phone number helper" do | ||
include PhoneNumberHelper | ||
|
||
context "validates phone number" do | ||
it "with empty string" do | ||
valid, error = valid_phone_number("") | ||
expect(valid).to be(true) | ||
expect(error).to be_nil | ||
end | ||
RSpec.describe PhoneNumberHelper, type: :helper do | ||
context "validates phone number" do | ||
it "with empty string" do | ||
valid, error = valid_phone_number("") | ||
expect(valid).to be(true) | ||
expect(error).to be_nil | ||
end | ||
|
||
it "with 10 digit phone number prepended with US country code" do | ||
valid, error = valid_phone_number("+12223334444") | ||
expect(valid).to be(true) | ||
expect(error).to be_nil | ||
end | ||
it "with 10 digit phone number prepended with US country code" do | ||
valid, error = valid_phone_number("+12223334444") | ||
expect(valid).to be(true) | ||
expect(error).to be_nil | ||
end | ||
|
||
it "with 10 digit phone number prepended with US country code without the plus sign" do | ||
valid, error = valid_phone_number("12223334444") | ||
expect(valid).to be(true) | ||
expect(error).to be_nil | ||
end | ||
it "with 10 digit phone number prepended with US country code without the plus sign" do | ||
valid, error = valid_phone_number("12223334444") | ||
expect(valid).to be(true) | ||
expect(error).to be_nil | ||
end | ||
|
||
it "with 10 phone number with spaces" do | ||
valid, error = valid_phone_number("222 333 4444") | ||
expect(valid).to be(true) | ||
expect(error).to be_nil | ||
end | ||
it "with 10 phone number with spaces" do | ||
valid, error = valid_phone_number("222 333 4444") | ||
expect(valid).to be(true) | ||
expect(error).to be_nil | ||
end | ||
|
||
it "with 10 phone number with parentheses" do | ||
valid, error = valid_phone_number("(222)3334444") | ||
expect(valid).to be(true) | ||
expect(error).to be_nil | ||
end | ||
it "with 10 phone number with parentheses" do | ||
valid, error = valid_phone_number("(222)3334444") | ||
expect(valid).to be(true) | ||
expect(error).to be_nil | ||
end | ||
|
||
it "with 10 phone number with dashes" do | ||
valid, error = valid_phone_number("222-333-4444") | ||
expect(valid).to be(true) | ||
expect(error).to be_nil | ||
end | ||
it "with 10 phone number with dashes" do | ||
valid, error = valid_phone_number("222-333-4444") | ||
expect(valid).to be(true) | ||
expect(error).to be_nil | ||
end | ||
|
||
it "with 10 phone number with dots" do | ||
valid, error = valid_phone_number("222.333.4444") | ||
expect(valid).to be(true) | ||
expect(error).to be_nil | ||
end | ||
it "with 10 phone number with dots" do | ||
valid, error = valid_phone_number("222.333.4444") | ||
expect(valid).to be(true) | ||
expect(error).to be_nil | ||
end | ||
end | ||
|
||
context "invalidates phone number" do | ||
it "with incorrect country code" do | ||
valid, error = valid_phone_number("+22223334444") | ||
expect(valid).to be(false) | ||
expect(error).to have_text("must be 10 digits or 12 digits including country code (+1)") | ||
end | ||
context "invalidates phone number" do | ||
it "with incorrect country code" do | ||
valid, error = valid_phone_number("+22223334444") | ||
expect(valid).to be(false) | ||
expect(error).to have_text("must be 10 digits or 12 digits including country code (+1)") | ||
end | ||
|
||
it "with short phone number" do | ||
valid, error = valid_phone_number("+122") | ||
expect(valid).to be(false) | ||
expect(error).to have_text("must be 10 digits or 12 digits including country code (+1)") | ||
end | ||
it "with short phone number" do | ||
valid, error = valid_phone_number("+122") | ||
expect(valid).to be(false) | ||
expect(error).to have_text("must be 10 digits or 12 digits including country code (+1)") | ||
end | ||
|
||
it "with long phone number" do | ||
valid, error = valid_phone_number("+12223334444555") | ||
expect(valid).to be(false) | ||
expect(error).to have_text("must be 10 digits or 12 digits including country code (+1)") | ||
end | ||
it "with long phone number" do | ||
valid, error = valid_phone_number("+12223334444555") | ||
expect(valid).to be(false) | ||
expect(error).to have_text("must be 10 digits or 12 digits including country code (+1)") | ||
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
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
Oops, something went wrong.