Metrics/ModuleLength:
Max: 150
-Minitest/MultipleAssertions:
- Enabled: false
-
Naming/FileName:
Exclude:
- 'script/deliver-message'
- rubocop-rails
- rubocop-rake
+# Offense count: 11
+# Configuration parameters: Include, MaxAmount
+FactoryBot/ExcessiveCreateList:
+ MaxAmount: 200
+
# Offense count: 557
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
specs:
aasm (5.5.0)
concurrent-ruby (~> 1.0)
+ abbrev (0.1.2)
actioncable (7.1.2)
actionpack (= 7.1.2)
activesupport (= 7.1.2)
autoprefixer-rails (10.4.16.0)
execjs (~> 2)
aws-eventstream (1.3.0)
- aws-partitions (1.876.0)
+ aws-partitions (1.877.0)
aws-sdk-core (3.190.1)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.8)
jmespath (~> 1, >= 1.6.1)
- aws-sdk-kms (1.75.0)
+ aws-sdk-kms (1.76.0)
aws-sdk-core (~> 3, >= 3.188.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.142.0)
dry-logic (>= 1.4, < 2)
dry-types (>= 1.7, < 2)
zeitwerk (~> 2.6)
- dry-types (1.7.1)
+ dry-types (1.7.2)
+ bigdecimal (~> 3.0)
concurrent-ruby (~> 1.0)
dry-core (~> 1.0)
dry-inflector (~> 1.0)
factory_bot_rails (6.4.3)
factory_bot (~> 6.4)
railties (>= 5.0.0)
- faraday (2.8.1)
- base64
- faraday-net_http (>= 2.0, < 3.1)
- ruby2_keywords (>= 0.0.4)
- faraday-net_http (3.0.2)
+ faraday (2.9.0)
+ faraday-net_http (>= 2.0, < 3.2)
+ faraday-net_http (3.1.0)
+ net-http
ffi (1.16.3)
ffi-compiler (1.0.1)
ffi (>= 1.0.0)
ffi (>= 1.0.0)
globalid (1.2.1)
activesupport (>= 6.1)
- google-protobuf (3.25.1)
+ google-protobuf (3.25.2)
hashdiff (1.1.0)
hashie (5.0.0)
- highline (2.1.0)
+ highline (3.0.0)
+ abbrev
htmlentities (4.3.4)
http_accept_language (2.1.1)
i18n (1.14.1)
image_size (3.3.0)
in_threads (1.6.0)
io-console (0.7.1)
- irb (1.11.0)
+ irb (1.11.1)
rdoc
- reline (>= 0.3.8)
+ reline (>= 0.4.2)
jbuilder (2.11.5)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
rexml
language_server-protocol (3.17.0.3)
libv8-node (18.16.0.0)
- libxml-ruby (4.1.2)
+ libxml-ruby (5.0.2)
listen (3.8.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
multi_json (1.15.0)
multi_xml (0.6.0)
mutex_m (0.2.0)
- net-imap (0.4.9)
+ net-http (0.4.1)
+ uri
+ net-imap (0.4.9.1)
date
net-protocol
net-pop (0.1.2)
net-protocol
net-protocol (0.2.2)
timeout
- net-smtp (0.4.0)
+ net-smtp (0.4.0.1)
net-protocol
nio4r (2.7.0)
nokogiri (1.16.0)
omniauth (~> 2.0)
openstreetmap-deadlock_retry (1.3.1)
parallel (1.24.0)
- parser (3.2.2.4)
+ parser (3.3.0.2)
ast (~> 2.4.1)
racc
pg (1.5.4)
psych (5.1.2)
stringio
public_suffix (5.0.4)
- puma (5.6.7)
+ puma (5.6.8)
nio4r (~> 2.0)
quad_tile (1.0.1)
racc (1.7.3)
ffi (~> 1.0)
rdoc (6.6.2)
psych (>= 4.0.0)
- regexp_parser (2.8.3)
- reline (0.4.1)
+ regexp_parser (2.9.0)
+ reline (0.4.2)
io-console (~> 0.5)
request_store (1.5.1)
rack (>= 1.4)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.30.0)
parser (>= 3.2.1.0)
- rubocop-capybara (2.19.0)
+ rubocop-capybara (2.20.0)
+ rubocop (~> 1.41)
+ rubocop-factory_bot (2.25.1)
rubocop (~> 1.41)
- rubocop-factory_bot (2.24.0)
- rubocop (~> 1.33)
- rubocop-minitest (0.34.3)
+ rubocop-minitest (0.34.4)
rubocop (>= 1.39, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
- rubocop-performance (1.20.1)
+ rubocop-performance (1.20.2)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
rubocop-rails (2.23.1)
activesupport (>= 5.2)
sprockets (>= 3.0.0)
stringio (3.1.0)
- strong_migrations (1.6.4)
+ strong_migrations (1.7.0)
activerecord (>= 5.2)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.5.0)
+ uri (0.13.0)
validates_email_format_of (1.7.2)
i18n
vendorer (0.2.0)
test "the status is deleted and the personal data removed" do
visit edit_account_path
- click_link "Delete Account..."
+ click_on "Delete Account..."
accept_confirm do
- click_link "Delete Account"
+ click_on "Delete Account"
end
assert_current_path root_path
test "the user is signed out after deletion" do
visit edit_account_path
- click_link "Delete Account..."
+ click_on "Delete Account..."
accept_confirm do
- click_link "Delete Account"
+ click_on "Delete Account"
end
assert_content "Log In"
test "the user is shown a confirmation flash message" do
visit edit_account_path
- click_link "Delete Account..."
+ click_on "Delete Account..."
accept_confirm do
- click_link "Delete Account"
+ click_on "Delete Account"
end
assert_content "Account Deleted"
travel 1.hour do
visit edit_account_path
- click_link "Delete Account..."
+ click_on "Delete Account..."
assert_no_content "cannot currently be deleted"
end
travel 1.hour do
visit edit_account_path
- click_link "Delete Account..."
+ click_on "Delete Account..."
assert_no_content "cannot currently be deleted"
end
travel 12.hours do
visit edit_account_path
- click_link "Delete Account..."
+ click_on "Delete Account..."
assert_no_content "cannot currently be deleted"
end
travel 10.hours do
visit edit_account_path
- click_link "Delete Account..."
+ click_on "Delete Account..."
assert_content "cannot currently be deleted"
assert_content "in about 1 hour"
@user = build(:user)
visit user_new_path
- fill_in "Email", :with => @user.email
- fill_in "Email Confirmation", :with => @user.email
- fill_in "Display Name", :with => @user.display_name
- fill_in "Password", :with => "testtest"
- fill_in "Confirm Password", :with => "testtest"
- click_button "Sign Up"
+ within ".new_user" do
+ fill_in "Email", :with => @user.email
+ fill_in "Email Confirmation", :with => @user.email
+ fill_in "Display Name", :with => @user.display_name
+ fill_in "Password", :with => "testtest"
+ fill_in "Confirm Password", :with => "testtest"
+ click_on "Sign Up"
+ end
check "I have read and agree to the above contributor terms"
check "I have read and agree to the Terms of Use"
- click_button "Continue"
+ click_on "Continue"
end
test "flash message should not contain raw html" do
sign_in_as(create(:user))
visit diary_entries_path
- click_link "Send a message to the author"
+ click_on "Send a message to the author"
assert_content "Send a new message"
assert_equal "Re: #{@diary_entry.title}", page.find_field("Subject").value
# No issues against the user
visit issues_path
fill_in "search_by_user", :with => good_user.display_name
- click_button "Search"
+ click_on "Search"
assert_no_content I18n.t("issues.index.user_not_found")
assert_content I18n.t("issues.index.issues_not_found")
# User doesn't exist
visit issues_path
fill_in "search_by_user", :with => "Nonexistent User"
- click_button "Search"
+ click_on "Search"
assert_content I18n.t("issues.index.user_not_found")
assert_content I18n.t("issues.index.issues_not_found")
# Find Issue against bad_user
visit issues_path
fill_in "search_by_user", :with => bad_user.display_name
- click_button "Search"
+ click_on "Search"
assert_no_content I18n.t("issues.index.user_not_found")
assert_no_content I18n.t("issues.index.issues_not_found")
end
visit issue_path(issue)
fill_in :issue_comment_body, :with => "test comment"
- click_button "Add Comment"
+ click_on "Add Comment"
assert_content I18n.t("issue_comments.create.comment_created")
assert_content "test comment"
fill_in :issue_comment_body, :with => "reassigning to moderators"
check :reassign
- click_button "Add Comment"
+ click_on "Add Comment"
assert_content "and the issue was reassigned"
assert_current_path issues_path(:status => "open")
fill_in :issue_comment_body, :with => "reassigning to moderators"
check :reassign
- click_button "Add Comment"
+ click_on "Add Comment"
assert_content "and the issue was reassigned"
assert_current_path issue_path(issue)
visit inbox_messages_path
assert_text "You have 1 new message and 0 old messages"
- click_button "Delete"
+ click_on "Delete"
assert_text "You have 0 new messages and 0 old messages"
end
visit outbox_messages_path
assert_text "You have 1 sent message"
- click_button "Delete"
+ click_on "Delete"
assert_text "You have 0 sent messages"
end
visit muted_messages_path
assert_text "1 muted message"
- click_button "Delete"
+ click_on "Delete"
assert_text "0 muted messages"
end
end
assert_button "Comment & Resolve"
assert_button "Comment", :disabled => false
- click_button "Comment"
+ click_on "Comment"
assert_content "Comment from #{user.display_name}"
assert_content "Some newly added note comment"
assert_text "OpenStreetMap Web Site"
accept_alert do
- click_link "Revoke Access"
+ click_on "Revoke Access"
end
assert_text "You have not yet authorized any OAuth 2 applications."
sign_in_as(create(:user))
visit edit_preferences_path
- click_button "Update Preferences"
+ click_on "Update Preferences"
assert_content "Preferences updated"
end
visit edit_preferences_path
fill_in "Preferred Languages", :with => "fr"
- click_button "Update Preferences"
+ click_on "Update Preferences"
assert_content "Préférences mises à jour"
end
visit diary_entry_path(@diary_entry.user.display_name, @diary_entry)
assert_content @diary_entry.title
- click_link I18n.t("diary_entries.diary_comment.report")
+ click_on I18n.t("diary_entries.diary_comment.report")
assert_content "Report"
assert_content I18n.t("reports.new.disclaimer.intro")
choose I18n.t("reports.new.categories.diary_comment.spam_label")
fill_in "report_details", :with => "This comment is spam"
assert_difference "Issue.count", 1 do
- click_button "Create Report"
+ click_on "Create Report"
end
assert_content "Your report has been registered successfully"
visit diary_entry_path(@diary_entry.user.display_name, @diary_entry)
assert_content @diary_entry.title
- click_link I18n.t("diary_entries.diary_entry.report")
+ click_on I18n.t("diary_entries.diary_entry.report")
assert_content "Report"
assert_content I18n.t("reports.new.disclaimer.intro")
choose I18n.t("reports.new.categories.diary_entry.spam_label")
fill_in "report_details", :with => "This is advertising"
assert_difference "Issue.count", 1 do
- click_button "Create Report"
+ click_on "Create Report"
end
assert_content "Your report has been registered successfully"
visit diary_entry_path(@diary_entry.user.display_name, @diary_entry)
assert_content @diary_entry.title
- click_link I18n.t("diary_entries.diary_entry.report")
+ click_on I18n.t("diary_entries.diary_entry.report")
assert_content "Report"
assert_content I18n.t("reports.new.disclaimer.intro")
choose I18n.t("reports.new.categories.diary_entry.spam_label")
fill_in "report_details", :with => "This is advertising"
assert_no_difference "Issue.count" do
- click_button "Create Report"
+ click_on "Create Report"
end
issue.reload
sign_in_as(create(:user))
visit note_path(note)
- click_link I18n.t("notes.show.report")
+ click_on I18n.t("notes.show.report")
assert_content "Report"
assert_content I18n.t("reports.new.disclaimer.intro")
choose I18n.t("reports.new.categories.note.spam_label")
fill_in "report_details", :with => "This is spam"
assert_difference "Issue.count", 1 do
- click_button "Create Report"
+ click_on "Create Report"
end
assert_content "Your report has been registered successfully"
sign_in_as(create(:user))
visit note_path(note)
- click_link I18n.t("notes.show.report")
+ click_on I18n.t("notes.show.report")
assert_content "Report"
assert_content I18n.t("reports.new.disclaimer.intro")
choose I18n.t("reports.new.categories.note.spam_label")
fill_in "report_details", :with => "This is spam"
assert_difference "Issue.count", 1 do
- click_button "Create Report"
+ click_on "Create Report"
end
assert_content "Your report has been registered successfully"
sign_in_as(create(:user))
visit user_path(user)
- click_link I18n.t("users.show.report")
+ click_on I18n.t("users.show.report")
assert_content "Report"
assert_content I18n.t("reports.new.disclaimer.intro")
choose I18n.t("reports.new.categories.user.vandal_label")
fill_in "report_details", :with => "This user is a vandal"
assert_difference "Issue.count", 1 do
- click_button "Create Report"
+ click_on "Create Report"
end
assert_content "Your report has been registered successfully"
sign_in_as(create(:user))
visit user_path(user)
- click_link I18n.t("users.show.report")
+ click_on I18n.t("users.show.report")
assert_content "Report"
assert_content I18n.t("reports.new.disclaimer.intro")
choose I18n.t("reports.new.categories.user.vandal_label")
fill_in "report_details", :with => "This user is a vandal"
assert_difference "Issue.count", 1 do
- click_button "Create Report"
+ click_on "Create Report"
end
assert_content "Your report has been registered successfully"
visit user_path(user)
- click_link I18n.t("users.show.report")
+ click_on I18n.t("users.show.report")
assert_content "Report"
assert_content I18n.t("reports.new.disclaimer.intro")
choose I18n.t("reports.new.categories.user.spam_label")
fill_in "report_details", :with => "This user is a spammer"
assert_no_difference "Issue.count" do
- click_button "Create Report"
+ click_on "Create Report"
end
assert_content "Your report has been registered successfully"
visit user_path(blocked_user)
assert_link "Revoke all blocks"
- click_link "Revoke all blocks"
+ click_on "Revoke all blocks"
assert_title "Revoking all blocks on #{blocked_user.display_name}"
assert_text "Revoking all blocks on #{blocked_user.display_name}"
assert_unchecked_field "Are you sure you wish to revoke 1 active block?"
visit user_path(blocked_user)
assert_link "Revoke all blocks"
- click_link "Revoke all blocks"
+ click_on "Revoke all blocks"
assert_title "Revoking all blocks on #{blocked_user.display_name}"
assert_text "Revoking all blocks on #{blocked_user.display_name}"
assert_unchecked_field "Are you sure you wish to revoke 2 active blocks?"
sign_in_as(user)
assert_no_content "Log In"
- click_button user.display_name
- click_link "Log Out"
+ click_on user.display_name
+ click_on "Log Out"
assert_content "Log In"
end
visit traces_path
assert_no_content "Log In"
- click_button user.display_name
- click_link "Log Out"
+ click_on user.display_name
+ click_on "Log Out"
assert_content "Log In"
assert_content "Public GPS Traces"
end
visit logout_path
assert_content "Logout from OpenStreetMap"
- click_button "Logout"
+ click_on "Logout"
assert_content "Log In"
end
visit logout_path(:referer => "/traces")
assert_content "Logout from OpenStreetMap"
- click_button "Logout"
+ click_on "Logout"
assert_content "Log In"
assert_content "Public GPS Traces"
end
sign_in_as(user)
visit user_path(other_user)
- click_link "Mute this User"
+ click_on "Mute this User"
assert_content "You muted #{other_user.display_name}"
visit edit_account_path
assert_content "Muted Users"
- click_link "Muted Users"
+ click_on "Muted Users"
assert_content "You have muted 1 User"
- click_link "Unmute"
+ click_on "Unmute"
assert_content "You unmuted #{other_user.display_name}"
refute_content "Muted Users"
fill_in "Body", :with => "some message"
assert_no_emails do
- click_button "Send"
+ click_on "Send"
end
message = Message.find_by(:sender => muted_user, :recipient => user)
test "Sign up from login page" do
visit login_path
- click_link "Register now"
+ click_on "Register now"
assert_content "Confirm Password"
end
user = build(:user)
visit root_path
- click_link "Sign Up"
- fill_in "Email", :with => user.email
- fill_in "Email Confirmation", :with => user.email
- fill_in "Display Name", :with => user.display_name
- fill_in "Password", :with => "testtest"
- fill_in "Confirm Password", :with => "testtest"
- click_button "Sign Up"
+ click_on "Sign Up"
+
+ within ".new_user" do
+ fill_in "Email", :with => user.email
+ fill_in "Email Confirmation", :with => user.email
+ fill_in "Display Name", :with => user.display_name
+ fill_in "Password", :with => "testtest"
+ fill_in "Confirm Password", :with => "testtest"
+ click_on "Sign Up"
+ end
assert_content "Contributor terms"
- click_button "Cancel"
+ click_on "Cancel"
assert_current_path "https://wiki.openstreetmap.org/wiki/Contributor_Terms_Declined"
end
user = create(:user, :suspended)
visit user_path(user)
accept_confirm do
- click_link "Unsuspend"
+ click_on "Unsuspend"
end
assert_no_content "Unsuspend"
user = create(:user, :suspended)
visit user_path(user)
accept_confirm do
- click_link "Confirm"
+ click_on "Confirm"
end
assert_no_content "Unsuspend"
visit edit_preferences_path
fill_in "Preferred Languages", :with => "fr"
- click_button "Update Preferences"
+ click_on "Update Preferences"
visit "/communities"
assert_link "OpenStreetMap États-Unis", :href => "https://www.openstreetmap.us/"
visit login_path
fill_in "username", :with => user.email
fill_in "password", :with => "test"
- click_button "Login", :match => :first
+ click_on "Login", :match => :first
end
def session_for(user)