source stringclasses 1
value | repo stringlengths 5 63 | repo_url stringlengths 24 82 | path stringlengths 5 167 | language stringclasses 1
value | license stringclasses 5
values | stars int64 10 51.4k | ref stringclasses 23
values | size_bytes int64 200 258k | text stringlengths 137 258k |
|---|---|---|---|---|---|---|---|---|---|
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/system/account_api_keys_system_test.rb | Ruby | mit | 84 | main | 3,033 | # frozen_string_literal: true
require("application_system_test_case")
class AccountAPIKeysSystemTest < ApplicationSystemTestCase
def test_api_keys
mary = users("mary")
# Mary has one existing api key, "marys_api_key"
marys_api_key = api_keys("marys_api_key")
login!(mary)
visit(account_api_keys_p... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/system/location_form_system_test.rb | Ruby | mit | 84 | main | 2,206 | # frozen_string_literal: true
require("application_system_test_case")
class LocationFormSystemTest < ApplicationSystemTestCase
def test_format_new_location_name
# browser = page.driver.browser
rolf = users("rolf")
login!(rolf)
visit("/locations/new")
assert_selector("body.locations__new")
... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/system/project_alias_form_system_test.rb | Ruby | mit | 84 | main | 1,310 | # frozen_string_literal: true
require("application_system_test_case")
class ProjectAliasFormSystemTest < ApplicationSystemTestCase
def test_type_switch_shows_correct_autocompleter
rolf = users(:rolf)
project = projects(:eol_project)
login!(rolf)
visit(new_project_alias_path(project_id: project.id))... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/system/observation_comment_system_test.rb | Ruby | mit | 84 | main | 8,328 | # frozen_string_literal: true
require("application_system_test_case")
class ObservationCommentSystemTest < ApplicationSystemTestCase
# Katrina makes a comment on Rolf's observation.
# Rolf should get the comment immediately via websocket.
# Katrina edits the comment, rolf should get the change immediately.
# ... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/system/help_identify_system_test.rb | Ruby | mit | 84 | main | 5,064 | # frozen_string_literal: true
require("application_system_test_case")
class HelpIdentifySystemTest < ApplicationSystemTestCase
def test_identify_index_naming_and_vote_ui
browser = page.driver.browser
rolf = users("rolf")
login!(rolf)
within("#navigation") do
assert_link("Help Identify")
... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/system/occurrence_form_system_test.rb | Ruby | mit | 84 | main | 1,032 | # frozen_string_literal: true
require("application_system_test_case")
class OccurrenceFormSystemTest < ApplicationSystemTestCase
def test_create_occurrence_submits_form
rolf = users("rolf")
obs1 = observations(:minimal_unknown_obs)
obs2 = observations(:coprinus_comatus_obs)
ObservationView.create!(... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/system/herbarium_form_system_test.rb | Ruby | mit | 84 | main | 5,895 | # frozen_string_literal: true
require("application_system_test_case")
class HerbariumFormSystemTest < ApplicationSystemTestCase
def test_create_fungarium_new_location
rolf = users("rolf")
login!(rolf)
visit("/herbaria/new")
assert_selector("body.herbaria__new")
create_herbarium_with_new_locatio... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/system/observation_show_system_test.rb | Ruby | mit | 84 | main | 10,033 | # frozen_string_literal: true
require("application_system_test_case")
class ObservationShowSystemTest < ApplicationSystemTestCase
setup do
@obs = observations(:peltigera_obs)
end
def test_visit_show_observation
# # browser = page.driver.browser
rolf = users("rolf")
login!(rolf)
assert_link... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/system/image_upload_system_test.rb | Ruby | mit | 84 | main | 2,600 | # frozen_string_literal: true
require("application_system_test_case")
class ImageUploadSystemTest < ApplicationSystemTestCase
def test_create_glossary_term_with_image_upload
setup_image_dirs
user = users("rolf")
login!(user)
visit(new_glossary_term_path)
assert_selector("body.glossary_terms__n... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/system/observation_form_system_test.rb | Ruby | mit | 84 | main | 50,883 | # frozen_string_literal: true
require("application_system_test_case")
class ObservationFormSystemTest < ApplicationSystemTestCase
def test_create_minimal_observation
browser = page.driver.browser
user = users(:zero_user)
login!(user)
assert_link("Create Observation")
click_on("Create Observatio... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/system/autocompleter_system_test.rb | Ruby | mit | 84 | main | 18,590 | # frozen_string_literal: true
require("application_system_test_case")
class AutocompleterSystemTest < ApplicationSystemTestCase
setup do
@browser = page.driver.browser
@roy = users("roy")
end
def test_observation_search_name_autocompleter
login!(@roy)
visit("/observations/search/new")
asse... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/system/local_time_system_test.rb | Ruby | mit | 84 | main | 3,180 | # frozen_string_literal: true
require("application_system_test_case")
class LocalTimeSystemTest < ApplicationSystemTestCase
def test_matrix_box_footer_time_converted_to_local
login!(users("rolf"))
# Visit observations index which has matrix boxes with timestamps
visit("/")
assert_selector("body.obs... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/system/user_fixture_helpers_system_test.rb | Ruby | mit | 84 | main | 866 | # frozen_string_literal: true
require("application_system_test_case")
# Test that user fixture helper methods work in system tests
class UserFixtureHelpersSystemTest < ApplicationSystemTestCase
def test_existing_user_helpers_still_work
# These had explicit method definitions before
assert_equal(users(:rolf)... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/system/list_form_system_test.rb | Ruby | mit | 84 | main | 2,479 | # frozen_string_literal: true
require("application_system_test_case")
class ListFormSystemTest < ApplicationSystemTestCase
def test_multi_autocompleter
@browser = page.driver.browser
rolf = users("rolf")
login!(rolf)
species_list = species_lists("first_species_list")
visit("/species_lists/#{spe... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/system/observation_naming_system_test.rb | Ruby | mit | 84 | main | 6,151 | # frozen_string_literal: true
require("application_system_test_case")
class ObservationNamingSystemTest < ApplicationSystemTestCase
def test_add_and_edit_naming
obs = observations(:coprinus_comatus_obs)
browser = page.driver.browser
rolf = users("rolf")
login!(rolf)
assert_link("Your Observati... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/support/inat_stub_helpers.rb | Ruby | mit | 84 | main | 1,105 | # frozen_string_literal: true
module InatStubHelpers
include Inat::Constants
# Stub iNat API genus lookup (based on ancestor ids)
# Need to lookup the genus of infrageneric taxa because
# the iNat API returns only epithet and rank, not the genus
def stub_genus_lookup(ancestor_ids:, body:)
stub_request(:... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/images_controller_test.rb | Ruby | mit | 84 | main | 10,086 | # frozen_string_literal: true
require("test_helper")
class ImagesControllerTest < FunctionalTestCase
# Tests of index, with tests arranged as follows:
# default subaction; then
# other subactions in order of index_active_params
def test_index_order
check_index_sorted_by(::Query::Images.default_order) # :c... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/names_controller_update_test.rb | Ruby | mit | 84 | main | 31,090 | # frozen_string_literal: true
require("test_helper")
class NamesControllerUpdateTest < FunctionalTestCase
tests NamesController
include ObjectLinkHelper
# EMAIL TESTS, currently in Names, Locations and their Descriptions
# Has to be defined on class itself, include doesn't seem to work
def self.report_emai... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/lookups_controller_test.rb | Ruby | mit | 84 | main | 9,546 | # frozen_string_literal: true
require("test_helper")
# ----------------------------
# Lookup's.
# These are links like /lookup_name/Amanita+muscaria
# They can be created by the Textile Sandbox, and should always redirect
# to the appropriate model.
# /lookup_accepted_name is intended for use by other web sites
#... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/rss_logs_controller_test.rb | Ruby | mit | 84 | main | 10,807 | # frozen_string_literal: true
require("test_helper")
class RssLogsControllerTest < FunctionalTestCase
def test_page_loads
get(:index)
assert_redirected_to(new_account_login_path)
login
get(:index)
assert_link_in_html(:app_intro.t, info_intro_path)
get(:rss)
assert_template(:rss)
g... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/projects_controller_test.rb | Ruby | mit | 84 | main | 20,355 | # frozen_string_literal: true
require("test_helper")
class ProjectsControllerTest < FunctionalTestCase
def build_params(
title, summary, start_date: nil, end_date: nil,
dates_any: "false"
)
{
project: {
title: title,
summary: summary,
field_slip_prefix: "",
place_... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/observations_controller_destroy_test.rb | Ruby | mit | 84 | main | 2,429 | # frozen_string_literal: true
require("test_helper")
class ObservationsControllerDestroyTest < FunctionalTestCase
tests ObservationsController
##############################################################################
# -------------------- Destroy ---------------------------------------- #
def test_de... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/names_controller_create_test.rb | Ruby | mit | 84 | main | 15,762 | # frozen_string_literal: true
require("test_helper")
class NamesControllerCreateTest < FunctionalTestCase
tests NamesController
include ObjectLinkHelper
def setup
@new_pts = 10
@chg_pts = 10
@auth_pts = 100
@edit_pts = 10
@@emails = []
super
end
def assert_no_emails
msg = @@e... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/add_dispatch_controller_test.rb | Ruby | mit | 84 | main | 7,282 | # frozen_string_literal: true
require("test_helper")
class AddDispatchControllerTest < FunctionalTestCase
def setup
super
@user = users(:rolf)
@project = projects(:bolete_project)
@species_list = species_lists(:first_species_list)
login(@user.login)
end
# Test login and with no parameters
... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/search_controller_test.rb | Ruby | mit | 84 | main | 11,978 | # frozen_string_literal: true
require("test_helper")
# Controller tests for search pages
class SearchControllerTest < FunctionalTestCase
def test_advanced
login
# Image advanced search retired 2021
[Name, Observation].each do |model|
get(
:advanced,
params: {
search: {
... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/interests_controller_test.rb | Ruby | mit | 84 | main | 4,524 | # frozen_string_literal: true
require("test_helper")
# users interests
class InterestsControllerTest < FunctionalTestCase
# Test list feature from left-hand column.
def test_index
login("rolf")
Interest.create(target: observations(:minimal_unknown_obs),
user: rolf, state: true)
Int... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/visual_models_controller_test.rb | Ruby | mit | 84 | main | 2,323 | # frozen_string_literal: true
require("test_helper")
class VisualModelsControllerTest < FunctionalTestCase
setup do
@visual_model = visual_models(:visual_model_one)
end
def test_should_get_index
login
get(:index)
assert_response(:success)
end
def test_should_get_new
login
get(:new)... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/support_controller_test.rb | Ruby | mit | 84 | main | 1,457 | # frozen_string_literal: true
require("test_helper")
class SupportControllerTest < FunctionalTestCase
# NOTE: zeitwerk does not autoload the /tests directory
require_relative("donations_controller_test_helpers")
include ::DonationsControllerTestHelpers
def test_gets
[
:donors,
:confirm,
... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/theme_controller_test.rb | Ruby | mit | 84 | main | 396 | # frozen_string_literal: true
require("test_helper")
# Test theme controller
class ThemeControllerTest < FunctionalTestCase
# Prove color_themes action succeeds.
def test_color_themes
login
get(:color_themes)
assert_response(:success)
end
def test_individual_themes
login
MO.themes.each do... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/autocompleters_controller_test.rb | Ruby | mit | 84 | main | 8,924 | # frozen_string_literal: true
require("test_helper")
require("json")
class AutocompletersControllerTest < FunctionalTestCase
def good_autocompleter_request(params = {})
autocompleter_request(params, 200)
end
def bad_autocompleter_request(params = {})
autocompleter_request(params, 500)
end
def auto... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/collection_numbers_controller_test.rb | Ruby | mit | 84 | main | 24,221 | # frozen_string_literal: true
require("test_helper")
class CollectionNumbersControllerTest < FunctionalTestCase
##############################################################################
# INDEX
#
def test_index
login
get(:index)
assert_page_title(:COLLECTION_NUMBERS.l)
end
def test_inde... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/api2_controller_test.rb | Ruby | mit | 84 | main | 22,245 | # frozen_string_literal: true
require("test_helper")
require("rexml/document")
class API2ControllerTest < FunctionalTestCase
include ActiveJob::TestHelper
def assert_api_failed
@api = assigns(:api)
assert_not(@api.errors.empty?, "Expected API to fail with errors.")
end
def assert_no_api_errors(msg =... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/observations_controller_index_test.rb | Ruby | mit | 84 | main | 26,384 | # frozen_string_literal: true
require("test_helper")
class ObservationsControllerIndexTest < FunctionalTestCase
tests ObservationsController
def setup
super
# Must do this to get center lats saved on fixtures without lat/lng.
Location.update_box_area_and_center_columns
end
######## Index #######... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/policy_controller_test.rb | Ruby | mit | 84 | main | 221 | # frozen_string_literal: true
require("test_helper")
class PolicyControllerTest < FunctionalTestCase
def test_privacy
get(:privacy)
assert_response(:success)
assert_head_title(:privacy_title.l)
end
end |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/javascript_controller_test.rb | Ruby | mit | 84 | main | 505 | # frozen_string_literal: true
require("test_helper")
# Controller tests for javascript utilities
class JavascriptControllerTest < FunctionalTestCase
def test_javascript_override
get(:turn_javascript_on)
assert_response(:redirect)
assert_equal(:on, session[:js_override])
get(:turn_javascript_off)
... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/application_controller_internationalization_test.rb | Ruby | mit | 84 | main | 1,601 | # frozen_string_literal: true
require("test_helper")
class ApplicationControllerInternationalizationTest < FunctionalTestCase
# Use TestController for these tests because we need a concrete controller
# and ApplicationController is abstract and has no routes/actions to call
tests TestController
# Test that s... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/field_slip_job_trackers_controller_test.rb | Ruby | mit | 84 | main | 359 | # frozen_string_literal: true
require("test_helper")
class FieldSlipJobTrackersControllerTest < FunctionalTestCase
def test_show
login
tracker = field_slip_job_trackers(:fsjt_page_one)
get(:show, params: { id: tracker.id }, format: :turbo_stream)
# response.body has the whole turbo_stream response
... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/observations_controller_show_test.rb | Ruby | mit | 84 | main | 34,081 | # frozen_string_literal: true
require("test_helper")
class ObservationsControllerShowTest < FunctionalTestCase
tests ObservationsController
##############################################################################
# ----------------------------
# General tests.
# ----------------------------
def ... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/licenses_controller_test.rb | Ruby | mit | 84 | main | 9,017 | # frozen_string_literal: true
require("test_helper")
class LicensesControllerTest < FunctionalTestCase
def test_index
login("rolf")
make_admin
get(:index)
assert(:success, "Admin should be able to see licenses index")
License.find_each do |license|
assert_select(
"a[href *= '#{lic... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/publications_controller_test.rb | Ruby | mit | 84 | main | 5,035 | # frozen_string_literal: true
require("test_helper")
class PublicationsControllerTest < FunctionalTestCase
def test_should_get_index
get(:index)
assert_response(:success)
assert_not_nil(assigns(:publications))
end
def test_should_get_index_for_user_who_owns_a_publication
pub_id = publications(:... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/articles_controller_test.rb | Ruby | mit | 84 | main | 7,961 | # frozen_string_literal: true
require("test_helper")
# Controller tests for news articles
class ArticlesControllerTest < FunctionalTestCase
############ test Actions that Display data (index, show, etc.)
def test_index
get(:index)
assert(:success, "Any user should be able to see article index")
Artic... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/herbaria_controller_test.rb | Ruby | mit | 84 | main | 34,383 | # frozen_string_literal: true
require("test_helper")
# tests of Herbarium controller
class HerbariaControllerTest < FunctionalTestCase
include ActiveJob::TestHelper
# ---------- Helpers ----------
def nybg
herbaria(:nybg_herbarium)
end
def fundis
herbaria(:fundis_herbarium)
end
def dicks_per... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/observation_views_controller_test.rb | Ruby | mit | 84 | main | 3,682 | # frozen_string_literal: true
require("test_helper")
# ------------------------------------------------------------
# Observation views - test updating the `reviewed` column
# ------------------------------------------------------------
class ObservationViewsControllerTest < FunctionalTestCase
def test_update_html... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/names_controller_update_merge_test.rb | Ruby | mit | 84 | main | 28,914 | # frozen_string_literal: true
require("test_helper")
class NamesControllerUpdateMergeTest < FunctionalTestCase
tests NamesController
include ObjectLinkHelper
# EMAIL TESTS, currently in Names, Locations and their Descriptions
# Has to be defined on class itself, include doesn't seem to work
def self.report... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/glossary_terms_controller_test.rb | Ruby | mit | 84 | main | 15,327 | # frozen_string_literal: true
require("test_helper")
# functional tests of glossary controller and views
class GlossaryTermsControllerTest < FunctionalTestCase
ESSENTIAL_ATTRIBUTES = %w[name description].freeze
# ---------- Test actions that Display data (index, show, etc.) --------------
# ***** index *****
... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/comments_controller_test.rb | Ruby | mit | 84 | main | 11,351 | # frozen_string_literal: true
require("test_helper")
class CommentsControllerTest < FunctionalTestCase
# Test of index, with tests arranged as follows:
# default subaction; then
# other subactions in order of index_active_params
def test_index
login
get(:index)
assert_template("index")
end
de... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/inat_imports_controller_test.rb | Ruby | mit | 84 | main | 26,111 | # frozen_string_literal: true
require("test_helper")
# a duck type of API2::ImageAPI with enough attributes
# to preventInatImportsController from throwing an error
class MockImageAPI
attr_reader :errors, :results
def initialize(errors: [], results: [])
@errors = errors
@results = results
end
end
# te... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/visual_groups_controller_test.rb | Ruby | mit | 84 | main | 3,598 | # frozen_string_literal: true
require("test_helper")
class VisualGroupsControllerTest < FunctionalTestCase
setup do
@visual_group = visual_groups(:visual_group_two)
@visual_model = @visual_group.visual_model
end
def test_should_get_index
login
get(:index, params: { visual_model_id: @visual_mode... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/observations_controller_create_test.rb | Ruby | mit | 84 | main | 46,411 | # frozen_string_literal: true
require("test_helper")
class ObservationsControllerCreateTest < FunctionalTestCase
include ActiveJob::TestHelper
tests ObservationsController
def modified_generic_params(params, user)
params[:observation] = sample_obs_fields.merge(params[:observation] || {})
params[:namin... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/occurrences_controller_test.rb | Ruby | mit | 84 | main | 32,697 | # frozen_string_literal: true
require("test_helper")
class OccurrencesControllerTest < FunctionalTestCase
def setup
@obs1 = observations(:minimal_unknown_obs)
@obs2 = observations(:coprinus_comatus_obs)
@obs3 = observations(:detailed_unknown_obs)
# Clear any occurrence from field slip fixture
@o... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/export_controller_test.rb | Ruby | mit | 84 | main | 2,959 | # frozen_string_literal: true
require("test_helper")
# Controller tests for setting export state of various objects
class ExportControllerTest < FunctionalTestCase
# Test setting export status of names and descriptions.
def test_set_export_status
name = names(:petigera)
params = {
id: name.id,
... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/observations_controller_update_test.rb | Ruby | mit | 84 | main | 20,992 | # frozen_string_literal: true
require("test_helper")
class ObservationsControllerUpdateTest < FunctionalTestCase
tests ObservationsController
# ----------------------------------------------------------------
# Test :edit and :update (note :update uses method: :put)
# ---------------------------------------... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/names_controller_index_test.rb | Ruby | mit | 84 | main | 16,177 | # frozen_string_literal: true
require("test_helper")
class NamesControllerIndexTest < FunctionalTestCase
tests NamesController
include ObjectLinkHelper
# ----------------------------
# Index tests.
# ----------------------------
#
# Tests arranged as follows:
# default subaction; then other subactio... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/account_controller_test.rb | Ruby | mit | 84 | main | 6,678 | # frozen_string_literal: true
require("test_helper")
# Test user AccountControllerTest
# signup, verification, prefs, profile, api
class AccountControllerTest < FunctionalTestCase
include ActiveJob::TestHelper
def setup
@request.host = "localhost"
super
end
##########################################... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/test_controller_test.rb | Ruby | mit | 84 | main | 219 | # frozen_string_literal: true
require("test_helper")
# Controller tests for info pages
class TestControllerTest < FunctionalTestCase
def test_tester
get(:index)
assert_equal(200, @response.status)
end
end |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/checklists_controller_test.rb | Ruby | mit | 84 | main | 5,906 | # frozen_string_literal: true
require("test_helper")
# Controller tests for checklists
class ChecklistsControllerTest < FunctionalTestCase
# Prove that Life List goes to correct page which has correct content
def test_checklist_for_user
login
user = users(:rolf)
expect = Name.joins(:observations).
... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/observations_controller_project_list_test.rb | Ruby | mit | 84 | main | 10,007 | # frozen_string_literal: true
require("test_helper")
class ObservationsControllerProjectListTest < FunctionalTestCase
tests ObservationsController
def test_inital_project_checkboxes
login("foray_newbie")
get(:new)
assert_project_checks(
# open membership, meets date constrains
projects(:... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/field_slips_controller_test.rb | Ruby | mit | 84 | main | 39,905 | # frozen_string_literal: true
require("test_helper")
class FieldSlipsControllerTest < FunctionalTestCase
setup do
@field_slip = field_slips(:field_slip_one)
end
def test_should_get_index
requires_login(:index)
assert_response(:success)
end
def test_should_get_index_at_id
oldest = field_sli... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/species_lists_controller_test.rb | Ruby | mit | 84 | main | 17,720 | # frozen_string_literal: true
require("test_helper")
class SpeciesListsControllerTest < FunctionalTestCase
# NOTE: I don't know how to grab the DEFAULT from the fixture set and
# User.find(ActiveRecord::FixtureSet.identify(:rolf)).contribution
# blows up in CI with
# Couldn't find User with 'id'=241228755 (... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/contributors_controller_test.rb | Ruby | mit | 84 | main | 497 | # frozen_string_literal: true
require("test_helper")
# ------------------------------------------------------------
# Contributors
# contributors_controller
# ------------------------------------------------------------
class ContributorsControllerTest < FunctionalTestCase
def test_page_load
login
get(:in... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/locations_controller_test.rb | Ruby | mit | 84 | main | 39,104 | # frozen_string_literal: true
require("test_helper")
class LocationsControllerTest < FunctionalTestCase
# EMAIL TESTS, currently in Names, Locations and their Descriptions
# Has to be defined on class itself, include doesn't seem to work
def self.report_email(email)
@@emails ||= []
@@emails << email
e... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/users_controller_test.rb | Ruby | mit | 84 | main | 5,477 | # frozen_string_literal: true
require("test_helper")
# ------------------------------------------------------------
# Users
# users_controller
# ------------------------------------------------------------
class UsersControllerTest < FunctionalTestCase
def modified_generic_params(params, user)
params[:usernam... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/translations_controller_test.rb | Ruby | mit | 84 | main | 15,504 | # frozen_string_literal: true
require("test_helper")
class TranslationsControllerTest < FunctionalTestCase
# Translation pages use many tags not in test locale files.
# Clear missing_tags to avoid false positives in teardown.
def teardown
Symbol.missing_tags = []
super
end
def mock_template
[
... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/names_controller_show_test.rb | Ruby | mit | 84 | main | 15,554 | # frozen_string_literal: true
require("test_helper")
class NamesControllerShowTest < FunctionalTestCase
tests NamesController
include ObjectLinkHelper
################################################
#
# SHOW
#
################################################
def test_show_name
# assert_equal(... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/herbarium_records_controller_test.rb | Ruby | mit | 84 | main | 24,587 | # frozen_string_literal: true
require("test_helper")
class HerbariumRecordsControllerTest < FunctionalTestCase
##############################################################################
# INDEX
#
def test_index
login
get(:index)
assert_response(:success)
assert_page_title(:HERBARIUM_RECOR... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/donations_controller_test_helpers.rb | Ruby | mit | 84 | main | 1,173 | # frozen_string_literal: true
# helper for shared test methods between Support and Admin::Donations
# NOTE: zeitwerk does not autoload the /tests directory
# Usage:
# class <YourTest> < <YourTestCase>
# require_relative("path/to/donations_controller_test_helpers")
# include ::DonationsControllerTestHelpers
mod... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/info_controller_test.rb | Ruby | mit | 84 | main | 1,943 | # frozen_string_literal: true
require("test_helper")
# Controller tests for info pages
class InfoControllerTest < FunctionalTestCase
def test_page_loads
login
get(:how_to_help)
assert_template(:how_to_help)
get(:how_to_use)
assert_template(:how_to_use)
get(:intro)
assert_template(:intr... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/sequences_controller_test.rb | Ruby | mit | 84 | main | 27,488 | # frozen_string_literal: true
require("test_helper")
# Controller tests for nucleotide sequences
class SequencesControllerTest < FunctionalTestCase
ITS_BASES =
"gagtatgtgc acacctgccg tctttatcta tccacctgtg cacacattgt agtcttgggg" \
"gattggttag cgacaatttt tgttgccatg tcgtcctctg gggtctatgt tatcataaac" \
"cac... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/locations/search_controller_test.rb | Ruby | mit | 84 | main | 2,779 | # frozen_string_literal: true
require("test_helper")
# ------------------------------------------------------------
# Locations search
# ------------------------------------------------------------
module Locations
class SearchControllerTest < FunctionalTestCase
def test_show_help
login
get(:show)
... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/locations/descriptions_controller_test.rb | Ruby | mit | 84 | main | 14,210 | # frozen_string_literal: true
require("test_helper")
module Locations
class DescriptionsControllerTest < FunctionalTestCase
include ObjectLinkHelper
##########################################################################
#
# SHOW
def test_show_location_description
# happy path
... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/locations/reverse_name_order_controller_test.rb | Ruby | mit | 84 | main | 602 | # frozen_string_literal: true
require("test_helper")
module Locations
class ReverseNameOrderControllerTest < FunctionalTestCase
# This is just a callback, so it can only test result
def test_reverse_name_order
login
mit = locations(:mitrula_marsh)
mit_original_name = mit.name
# this ... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/locations/maps_controller_test.rb | Ruby | mit | 84 | main | 580 | # frozen_string_literal: true
require("test_helper")
module Locations
class MapsControllerTest < FunctionalTestCase
include ObjectLinkHelper
def test_map_locations_all
login
get(:show)
assert_template("locations/maps/show")
end
def test_map_locations_empty
login
get(:... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/locations/help_controller_test.rb | Ruby | mit | 84 | main | 212 | # frozen_string_literal: true
require("test_helper")
module Locations
class HelpControllerTest < FunctionalTestCase
include ObjectLinkHelper
def test_location_help
get(:show)
end
end
end |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/locations/countries_controller_test.rb | Ruby | mit | 84 | main | 707 | # frozen_string_literal: true
require("test_helper")
module Locations
class CountriesControllerTest < FunctionalTestCase
# include ObjectLinkHelper
def test_countries_index
cc = CountryCounter.new
links_to_countries_with_obss = cc.known_by_count.length
links_to_other_localities_with_obss ... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/locations/versions_controller_test.rb | Ruby | mit | 84 | main | 602 | # frozen_string_literal: true
require("test_helper")
module Locations
class VersionsControllerTest < FunctionalTestCase
include ObjectLinkHelper
def test_show_past_location
location = locations(:albion)
login
get(:show,
params: { id: location.id, version: location.version - 1 })... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/locations/descriptions/moves_controller_test.rb | Ruby | mit | 84 | main | 4,131 | # frozen_string_literal: true
require("test_helper")
module Locations::Descriptions
class MovesControllerTest < FunctionalTestCase
include ObjectLinkHelper
# Dick's public desc for gualala. Readable/writable by all.
def public_desc
location_descriptions(:user_public_location_desc)
end
# ... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/locations/descriptions/merges_controller_test.rb | Ruby | mit | 84 | main | 4,642 | # frozen_string_literal: true
require("test_helper")
module Locations::Descriptions
class MergesControllerTest < FunctionalTestCase
include ObjectLinkHelper
# Dick's public desc for gualala. Readable/writable by all.
def public_desc
location_descriptions(:user_public_location_desc)
end
#... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/locations/descriptions/versions_controller_test.rb | Ruby | mit | 84 | main | 677 | # frozen_string_literal: true
require("test_helper")
module Locations::Descriptions
class VersionsControllerTest < FunctionalTestCase
include ObjectLinkHelper
def test_show_past_location_description
login("dick")
desc = location_descriptions(:albion_desc)
old_versions = desc.versions.leng... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/locations/descriptions/defaults_controller_test.rb | Ruby | mit | 84 | main | 1,081 | # frozen_string_literal: true
require("test_helper")
module Locations::Descriptions
class DefaultsControllerTest < FunctionalTestCase
def make_description_default_helper(desc)
user = desc.user
params = {
id: desc.id
}
put_requires_login(:update, params, user.login)
end
d... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/account/login_controller_test.rb | Ruby | mit | 84 | main | 4,176 | # frozen_string_literal: true
require("test_helper")
# tests of Login controller
module Account
class LoginControllerTest < FunctionalTestCase
include ActiveJob::TestHelper
def setup
@request.host = "localhost"
super
end
#################################################################... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/account/preferences_controller_test.rb | Ruby | mit | 84 | main | 11,663 | # frozen_string_literal: true
require("test_helper")
# tests of Preferences controller
module Account
class PreferencesControllerTest < FunctionalTestCase
GOOD_PARAMS = {
login: "rolf",
password: "new_password",
password_confirmation: "new_password",
email: "new@email.com",
email_c... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/account/verifications_controller_test.rb | Ruby | mit | 84 | main | 4,045 | # frozen_string_literal: true
require("test_helper")
# tests of Verifications controller
module Account
class VerificationsControllerTest < FunctionalTestCase
include ActiveJob::TestHelper
def test_anon_user_verify
get(:new)
assert_redirected_to(users_path)
end
# Normal verify action ... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/account/api_keys_controller_test.rb | Ruby | mit | 84 | main | 2,532 | # frozen_string_literal: true
require("test_helper")
# tests of Account API Keys controller
module Account
class APIKeysControllerTest < FunctionalTestCase
def test_api_key_manager
APIKey.find_each(&:destroy)
assert_equal(0, APIKey.count)
# Get initial (empty) form.
requires_login("inde... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/account/profile_controller_test.rb | Ruby | mit | 84 | main | 2,900 | # frozen_string_literal: true
require("test_helper")
# tests of Profile controller
module Account
class ProfileControllerTest < FunctionalTestCase
def test_edit
# First make sure it can serve the form to start with.
requires_login("edit")
# Now change everything. (Note this user owns no image... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/account/profile/images_controller_test.rb | Ruby | mit | 84 | main | 1,690 | # frozen_string_literal: true
require("test_helper")
# tests of Images controller
module Account::Profile
class ImagesControllerTest < FunctionalTestCase
# Prove there is no change when user tries to change profile image to itself
def test_reuse_user_profile_image_as_itself
user = users(:rolf)
a... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/herbaria/curators_controller_test.rb | Ruby | mit | 84 | main | 3,826 | # frozen_string_literal: true
require("test_helper")
# tests of Herbarium controller
module Herbaria
class CuratorsControllerTest < FunctionalTestCase
# ---------- Helpers ----------
def nybg
herbaria(:nybg_herbarium)
end
# ---------- Actions to Modify data: (create, update, destroy, etc.) --... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/herbaria/merges_controller_test.rb | Ruby | mit | 84 | main | 3,676 | # frozen_string_literal: true
require("test_helper")
module Herbaria
# tests of action to merge two herbaria
class MergesControllerTest < FunctionalTestCase
# ---------- Helpers ----------
def field_museum
herbaria(:field_museum)
end
def fundis
herbaria(:fundis_herbarium)
end
... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/herbaria/search_controller_test.rb | Ruby | mit | 84 | main | 1,663 | # frozen_string_literal: true
require("test_helper")
# ------------------------------------------------------------
# Herbaria search
# ------------------------------------------------------------
module Herbaria
class SearchControllerTest < FunctionalTestCase
def test_new_herbaria_search
login
get... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/herbaria/curator_requests_controller_test.rb | Ruby | mit | 84 | main | 2,189 | # frozen_string_literal: true
require("test_helper")
module Herbaria
# test of actions to request being a curator of a herbarium
class CuratorRequestsControllerTest < FunctionalTestCase
include ActiveJob::TestHelper
# ---------- Helpers ----------
def nybg
herbaria(:nybg_herbarium)
end
... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/test_pages/flash_redirection_controller_test.rb | Ruby | mit | 84 | main | 214 | # frozen_string_literal: true
require("test_helper")
# NOTE: page is tested in integration/rails_dom_testing/amateur_test.rb
module TestPages
class FlashRedirectionControllerTest < FunctionalTestCase
end
end |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/users/emails_controller_test.rb | Ruby | mit | 84 | main | 2,863 | # frozen_string_literal: true
require("test_helper")
module Users
class EmailsControllerTest < FunctionalTestCase
include ActiveJob::TestHelper
def test_ask_questions
id = mary.id
requires_login(:new, id: id)
assert_form_action(action: :create, id: id)
# Prove that trying to ask qu... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/names/eol_data_controller_test.rb | Ruby | mit | 84 | main | 214 | # frozen_string_literal: true
require("test_helper")
module Names
class EolDataControllerTest < FunctionalTestCase
include ObjectLinkHelper
def test_eol
login
get("show")
end
end
end |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/names/descriptions_controller_test.rb | Ruby | mit | 84 | main | 24,070 | # frozen_string_literal: true
require("test_helper")
module Names
class DescriptionsControllerTest < FunctionalTestCase
include ObjectLinkHelper
def empty_notes
NameDescription.all_note_fields.index_with do |_field|
""
end
end
CREATE_NAME_DESCRIPTION_PARTIALS = %w[
_field... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/names/classification_controller_test.rb | Ruby | mit | 84 | main | 3,003 | # frozen_string_literal: true
require("test_helper")
module Names
class ClassificationControllerTest < FunctionalTestCase
include ObjectLinkHelper
def test_get_edit_classification
name = names(:boletus_edulis)
# Make sure user has to be logged in.
get(:edit, params: { id: name.id })
... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/names/versions_controller_test.rb | Ruby | mit | 84 | main | 2,469 | # frozen_string_literal: true
require("test_helper")
module Names
class VersionsControllerTest < FunctionalTestCase
include ObjectLinkHelper
def test_show_past_name
login
get(:show, params: { id: names(:coprinus_comatus).id })
assert_template("names/versions/show")
end
def test_s... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/names/trackers_controller_test.rb | Ruby | mit | 84 | main | 5,847 | # frozen_string_literal: true
require("test_helper")
module Names
class TrackersControllerTest < FunctionalTestCase
include ObjectLinkHelper
include ActiveJob::TestHelper
# ----------------------------
# Name Trackers.
# ----------------------------
def test_email_tracking
name = na... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/names/synonyms_controller_test.rb | Ruby | mit | 84 | main | 27,774 | # frozen_string_literal: true
require("test_helper")
module Names
class SynonymsControllerTest < FunctionalTestCase
include ObjectLinkHelper
def test_change_synonyms
name = names(:chlorophyllum_rachodes)
params = { id: name.id }
requires_login(:edit, params)
assert_form_action(actio... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/names/maps_controller_test.rb | Ruby | mit | 84 | main | 2,694 | # frozen_string_literal: true
require("test_helper")
module Names
class MapsControllerTest < FunctionalTestCase
include ObjectLinkHelper
# ----------------------------
# Maps
# ----------------------------
# We do not offer maps for multiple names. You have to pass a name ID.
# name with ... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/names/lifeforms_controller_test.rb | Ruby | mit | 84 | main | 940 | # frozen_string_literal: true
require("test_helper")
module Names
class LifeformsControllerTest < FunctionalTestCase
include ObjectLinkHelper
def test_edit_lifeform
# Prove that anyone logged in can edit lifeform, and that the form starts
# off with the correct current state.
name = names... |
github | MushroomObserver/mushroom-observer | https://github.com/MushroomObserver/mushroom-observer | test/controllers/names/search_controller_test.rb | Ruby | mit | 84 | main | 7,463 | # frozen_string_literal: true
require("test_helper")
# ------------------------------------------------------------
# Names search
# ------------------------------------------------------------
module Names
class SearchControllerTest < FunctionalTestCase
def test_show_help
login
get(:show)
as... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.