Commit 377e0d3b authored by David Lucadou's avatar David Lucadou

Outlined new tests for admin reports search view

parent fa5a6898
Pipeline #60871994 failed with stage
in 8 minutes and 4 seconds
......@@ -8,20 +8,78 @@ include AuthenticationHelpers
RSpec.describe "AdminReportsSearch", type: :request do
before :each do
name = 'Test User 1'
email = 'testuser@domain.test'
password = 'CorrectHorseBatteryStaple'
sign_up_with(name, email, password, password)
expect(page).to have_content("Welcome! You have signed up successfully.")
expect(page).to have_content("Terms of Service")
click_on "Continue"
expect(page).to have_content("Thank you for accepting the terms of service!")
email = 'admin@domain.example'
password = 'passwordpassword1'
sign_in_with(email, password)
visit chat_logs_path
end
describe "Admin can" do
it "see reports from all users"
it "search all reports with no fields filled in"
it "search all reports with a report status"
it "search all reports with a reporting user ID"
# email and ID
it "search all reports with a message channel"
it "search all reports with a message sender"
it "search all reports with a case insensitive report reason without regex"
it "search all reports with a case sensitive report reason with regex"
it "search all reports with a case insensitive report reason with escaped regex"
it "search all reports with a case insensitive message text without regex"
it "search all reports with a case sensitive message text with regex"
it "search all reports with a case insensitive message text with escaped regex"
it "search all reports with a resolving user ID"
# email and ID
it "search all reports with a starting reported time before the current system time"
it "search all reports with a ending reported time before the current system time"
it "search all reports with a starting and ending reported time before the current system time"
it "search all reports with a custom results per page"
it "search all reports with multiple fields filled in"
end
describe "Admin cannot" do
it "search all reports with an invalid report status"
it "search all reports with an invalid report reason regex"
it "search all reports with an invalid reporting user email ID"
# invalid - incorrect format, i.e. not an email address
it "search all reports with a nonexistent reporting user email ID"
# nonexistent - no user exists with that email
it "search all reports with a nonexistent reporting user numerical ID"
# nonexistent - no user exists with that ID
it "search all reports with an invalid reporting user numerical ID"
# invalid - decimal value
it "search all reports with a reporting user numerical ID greater than 2147483647"
it "search all reports with a zero reporting user numerical ID"
it "search all reports with a negative reporting user numerical ID"
it "search all reports with a reporting user numerical ID less than -2147483648"
it "search all reports with an invalid message channel format"
it "search all reports with an invalid message sender format"
it "search all reports with an invalid message text regex"
it "search all reports with an invalid resolving user email ID"
# invalid - incorrect format, i.e. not an email address
it "search all reports with a nonexistent resolving user email ID"
# nonexistent - no user exists with that email
it "search all reports with a nonexistent resolving user numerical ID"
# nonexistent - no user exists with that ID
it "search all reports with an invalid resolving user numerical ID"
# invalid - decimal value
it "search all reports with a resolving user numerical ID greater than 2147483647"
it "search all reports with a zero resolving user numerical ID"
it "search all reports with a negative resolving user numerical ID"
it "search all reports with a resolving user numerical ID less than -2147483648"
it "search all reports with a starting reported time after the current system time"
it "search all reports with an ending reported time after the current system time"
it "search all reports with a starting and ending reported time after the current system time"
it "search all reports with an starting time after the ending time"
it "search all reports with an invalid reported time start format"
it "search all reports with an invalid reported time end format"
it "search all reports with invalid reported time start and end formats"
it "search all reports with an valid start time and invalid end time"
it "search all reports with an invalid start time and valid end time"
it "search all reports with per page below 10"
it "search all reports with per page above 1000"
it "search all reports with a decimal results per page"
it "search all reports with a non-numeric results per page"
it "search all reports with multiple fields filled in incorrectly"
end
end
\ No newline at end of file
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment