acts-as-messageable 0.5.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +8 -0
- data/.github/workflows/test.yml +152 -0
- data/.rubocop.yml +14 -1
- data/.rubocop_todo.yml +49 -7
- data/.ruby-version +1 -0
- data/Appraisals +11 -0
- data/Dockerfile +2 -1
- data/Gemfile +19 -13
- data/Gemfile.lock +186 -97
- data/README.md +2 -3
- data/Rakefile +6 -1
- data/VERSION +1 -1
- data/acts-as-messageable.gemspec +193 -40
- data/bin/tapioca +29 -0
- data/docker-compose.yml +82 -71
- data/gemfiles/rails_3.2.gemfile +14 -9
- data/gemfiles/rails_4.2.gemfile +14 -9
- data/gemfiles/rails_5.2.gemfile +14 -9
- data/gemfiles/rails_6.0.gemfile +14 -9
- data/gemfiles/rails_7.0.gemfile +29 -0
- data/gemfiles/rails_master.gemfile +15 -9
- data/lib/acts-as-messageable.rb +1 -0
- data/lib/acts_as_messageable/message.rb +62 -5
- data/lib/acts_as_messageable/model.rb +71 -20
- data/lib/acts_as_messageable/rails3.rb +27 -2
- data/lib/acts_as_messageable/rails4.rb +31 -4
- data/lib/acts_as_messageable/rails6.rb +34 -2
- data/lib/acts_as_messageable/railtie.rb +1 -0
- data/lib/acts_as_messageable/relation.rb +18 -2
- data/lib/acts_as_messageable/scopes.rb +11 -0
- data/lib/acts_as_messageable.rb +18 -0
- data/lib/generators/acts_as_messageable/migration/migration_generator.rb +4 -0
- data/lib/generators/acts_as_messageable/migration/templates/migration.rb +1 -0
- data/lib/generators/acts_as_messageable/migration/templates/migration_indexes.rb +1 -0
- data/lib/generators/acts_as_messageable/migration/templates/migration_opened_as_datetime.rb +1 -0
- data/lib/generators/acts_as_messageable/migration/templates/migration_permanent.rb +1 -0
- data/sorbet/config +4 -0
- data/sorbet/rbi/annotations/actionpack.rbi +428 -0
- data/sorbet/rbi/annotations/actionview.rbi +77 -0
- data/sorbet/rbi/annotations/activerecord.rbi +18 -0
- data/sorbet/rbi/annotations/activesupport.rbi +52 -0
- data/sorbet/rbi/annotations/faraday.rbi +17 -0
- data/sorbet/rbi/annotations/railties.rbi +58 -0
- data/sorbet/rbi/annotations/rainbow.rbi +269 -0
- data/sorbet/rbi/dsl/abstract_controller/caching/fragments.rbi +23 -0
- data/sorbet/rbi/dsl/abstract_controller/caching.rbi +30 -0
- data/sorbet/rbi/dsl/abstract_controller/callbacks.rbi +23 -0
- data/sorbet/rbi/dsl/abstract_controller/helpers.rbi +23 -0
- data/sorbet/rbi/dsl/abstract_controller/rendering.rbi +9 -0
- data/sorbet/rbi/dsl/abstract_controller/url_for.rbi +23 -0
- data/sorbet/rbi/dsl/action_controller/caching.rbi +29 -0
- data/sorbet/rbi/dsl/action_controller/conditional_get.rbi +23 -0
- data/sorbet/rbi/dsl/action_controller/content_security_policy.rbi +31 -0
- data/sorbet/rbi/dsl/action_controller/data_streaming.rbi +9 -0
- data/sorbet/rbi/dsl/action_controller/etag_with_flash.rbi +24 -0
- data/sorbet/rbi/dsl/action_controller/etag_with_template_digest.rbi +30 -0
- data/sorbet/rbi/dsl/action_controller/flash.rbi +19 -0
- data/sorbet/rbi/dsl/action_controller/form_builder.rbi +19 -0
- data/sorbet/rbi/dsl/action_controller/helpers.rbi +36 -0
- data/sorbet/rbi/dsl/action_controller/params_wrapper.rbi +23 -0
- data/sorbet/rbi/dsl/action_controller/redirecting.rbi +24 -0
- data/sorbet/rbi/dsl/action_controller/renderers/all.rbi +24 -0
- data/sorbet/rbi/dsl/action_controller/renderers.rbi +23 -0
- data/sorbet/rbi/dsl/action_controller/request_forgery_protection.rbi +31 -0
- data/sorbet/rbi/dsl/action_controller/rescue.rbi +24 -0
- data/sorbet/rbi/dsl/action_controller/test_case/behavior.rbi +24 -0
- data/sorbet/rbi/dsl/action_controller/url_for.rbi +24 -0
- data/sorbet/rbi/dsl/action_dispatch/routing/url_for.rbi +23 -0
- data/sorbet/rbi/dsl/action_view/helpers/form_helper.rbi +10 -0
- data/sorbet/rbi/dsl/action_view/helpers/form_tag_helper.rbi +10 -0
- data/sorbet/rbi/dsl/action_view/helpers/text_helper.rbi +9 -0
- data/sorbet/rbi/dsl/action_view/helpers.rbi +10 -0
- data/sorbet/rbi/dsl/action_view/layouts.rbi +24 -0
- data/sorbet/rbi/dsl/action_view/rendering.rbi +9 -0
- data/sorbet/rbi/dsl/active_model/attribute_methods.rbi +27 -0
- data/sorbet/rbi/dsl/active_model/attributes.rbi +34 -0
- data/sorbet/rbi/dsl/active_model/dirty.rbi +28 -0
- data/sorbet/rbi/dsl/active_model/serializers/json.rbi +22 -0
- data/sorbet/rbi/dsl/active_model/validations/callbacks.rbi +22 -0
- data/sorbet/rbi/dsl/active_model/validations.rbi +27 -0
- data/sorbet/rbi/dsl/active_record/attribute_methods/dirty.rbi +38 -0
- data/sorbet/rbi/dsl/active_record/attribute_methods/time_zone_conversion.rbi +32 -0
- data/sorbet/rbi/dsl/active_record/attribute_methods.rbi +53 -0
- data/sorbet/rbi/dsl/active_record/attributes.rbi +19 -0
- data/sorbet/rbi/dsl/active_record/callbacks.rbi +22 -0
- data/sorbet/rbi/dsl/active_record/core.rbi +55 -0
- data/sorbet/rbi/dsl/active_record/encryption/encryptable_record.rbi +23 -0
- data/sorbet/rbi/dsl/active_record/inheritance.rbi +27 -0
- data/sorbet/rbi/dsl/active_record/integration.rbi +32 -0
- data/sorbet/rbi/dsl/active_record/locking/optimistic.rbi +22 -0
- data/sorbet/rbi/dsl/active_record/model_schema.rbi +52 -0
- data/sorbet/rbi/dsl/active_record/nested_attributes.rbi +22 -0
- data/sorbet/rbi/dsl/active_record/readonly_attributes.rbi +19 -0
- data/sorbet/rbi/dsl/active_record/reflection.rbi +32 -0
- data/sorbet/rbi/dsl/active_record/scoping/default.rbi +23 -0
- data/sorbet/rbi/dsl/active_record/scoping.rbi +23 -0
- data/sorbet/rbi/dsl/active_record/serialization.rbi +22 -0
- data/sorbet/rbi/dsl/active_record/signed_id.rbi +22 -0
- data/sorbet/rbi/dsl/active_record/test_fixtures.rbi +58 -0
- data/sorbet/rbi/dsl/active_record/timestamp.rbi +23 -0
- data/sorbet/rbi/dsl/active_record/validations.rbi +28 -0
- data/sorbet/rbi/dsl/active_support/actionable_error.rbi +23 -0
- data/sorbet/rbi/dsl/active_support/callbacks.rbi +22 -0
- data/sorbet/rbi/dsl/active_support/rescuable.rbi +23 -0
- data/sorbet/rbi/dsl/active_support/testing/file_fixtures.rbi +22 -0
- data/sorbet/rbi/gems/actionpack@7.0.4.3.rbi +19265 -0
- data/sorbet/rbi/gems/actionview@7.0.4.3.rbi +15482 -0
- data/sorbet/rbi/gems/activemodel@7.0.4.3.rbi +6025 -0
- data/sorbet/rbi/gems/activerecord@7.0.4.3.rbi +37852 -0
- data/sorbet/rbi/gems/activesupport@7.0.4.3.rbi +18788 -0
- data/sorbet/rbi/gems/addressable@2.4.0.rbi +8 -0
- data/sorbet/rbi/gems/appraisal@2.4.1.rbi +584 -0
- data/sorbet/rbi/gems/ast@2.4.2.rbi +584 -0
- data/sorbet/rbi/gems/builder@3.2.4.rbi +8 -0
- data/sorbet/rbi/gems/coderay@1.1.3.rbi +3426 -0
- data/sorbet/rbi/gems/commander@4.6.0.rbi +8 -0
- data/sorbet/rbi/gems/concurrent-ruby@1.2.2.rbi +11545 -0
- data/sorbet/rbi/gems/coveralls_reborn@0.27.0.rbi +8 -0
- data/sorbet/rbi/gems/crass@1.0.6.rbi +622 -0
- data/sorbet/rbi/gems/descendants_tracker@0.0.4.rbi +8 -0
- data/sorbet/rbi/gems/diff-lcs@1.5.0.rbi +1079 -0
- data/sorbet/rbi/gems/docile@1.4.0.rbi +8 -0
- data/sorbet/rbi/gems/erubi@1.12.0.rbi +146 -0
- data/sorbet/rbi/gems/faraday@0.9.2.rbi +964 -0
- data/sorbet/rbi/gems/git@1.11.0.rbi +2700 -0
- data/sorbet/rbi/gems/github_api@0.16.0.rbi +8 -0
- data/sorbet/rbi/gems/hashie@5.0.0.rbi +8 -0
- data/sorbet/rbi/gems/highline@2.0.3.rbi +8 -0
- data/sorbet/rbi/gems/i18n@1.12.0.rbi +2296 -0
- data/sorbet/rbi/gems/jeweler@2.3.9.rbi +1591 -0
- data/sorbet/rbi/gems/json@2.6.3.rbi +1541 -0
- data/sorbet/rbi/gems/jwt@2.5.0.rbi +8 -0
- data/sorbet/rbi/gems/loofah@2.19.1.rbi +904 -0
- data/sorbet/rbi/gems/method_source@1.0.0.rbi +272 -0
- data/sorbet/rbi/gems/mime-types@2.99.3.rbi +8 -0
- data/sorbet/rbi/gems/minitest@5.18.0.rbi +1491 -0
- data/sorbet/rbi/gems/multi_json@1.15.0.rbi +8 -0
- data/sorbet/rbi/gems/multi_xml@0.6.0.rbi +8 -0
- data/sorbet/rbi/gems/multipart-post@2.2.3.rbi +8 -0
- data/sorbet/rbi/gems/netrc@0.11.0.rbi +158 -0
- data/sorbet/rbi/gems/nokogiri@1.14.2.rbi +7244 -0
- data/sorbet/rbi/gems/oauth2@1.4.8.rbi +8 -0
- data/sorbet/rbi/gems/parallel@1.22.1.rbi +277 -0
- data/sorbet/rbi/gems/pg@1.4.6.rbi +2574 -0
- data/sorbet/rbi/gems/polyfill@1.9.0.rbi +8 -0
- data/sorbet/rbi/gems/pry@0.14.2.rbi +10081 -0
- data/sorbet/rbi/gems/psych@4.0.6.rbi +1819 -0
- data/sorbet/rbi/gems/racc@1.6.2.rbi +155 -0
- data/sorbet/rbi/gems/rack-test@2.0.2.rbi +943 -0
- data/sorbet/rbi/gems/rack@2.2.6.4.rbi +5659 -0
- data/sorbet/rbi/gems/rails-dom-testing@2.0.3.rbi +455 -0
- data/sorbet/rbi/gems/rails-html-sanitizer@1.5.0.rbi +685 -0
- data/sorbet/rbi/gems/railties@7.0.4.3.rbi +4553 -0
- data/sorbet/rbi/gems/rainbow@3.1.1.rbi +8 -0
- data/sorbet/rbi/gems/rake@13.0.6.rbi +2959 -0
- data/sorbet/rbi/gems/rbi@0.0.16.rbi +3008 -0
- data/sorbet/rbi/gems/rbs@2.8.0.rbi +8 -0
- data/sorbet/rbi/gems/rchardet@1.8.0.rbi +1078 -0
- data/sorbet/rbi/gems/rdoc@6.5.0.rbi +12441 -0
- data/sorbet/rbi/gems/regexp_parser@2.7.0.rbi +8 -0
- data/sorbet/rbi/gems/rexml@3.2.5.rbi +8 -0
- data/sorbet/rbi/gems/rspec-core@3.12.0.rbi +10798 -0
- data/sorbet/rbi/gems/rspec-expectations@3.12.0.rbi +8090 -0
- data/sorbet/rbi/gems/rspec-mocks@3.12.0.rbi +5296 -0
- data/sorbet/rbi/gems/rspec-support@3.12.0.rbi +1617 -0
- data/sorbet/rbi/gems/rspec@3.12.0.rbi +88 -0
- data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +8 -0
- data/sorbet/rbi/gems/safe_type@1.1.1.rbi +8 -0
- data/sorbet/rbi/gems/semver2@3.4.2.rbi +8 -0
- data/sorbet/rbi/gems/simplecov-html@0.12.3.rbi +8 -0
- data/sorbet/rbi/gems/simplecov@0.22.0.rbi +8 -0
- data/sorbet/rbi/gems/simplecov_json_formatter@0.1.4.rbi +8 -0
- data/sorbet/rbi/gems/sorbet-coerce@0.7.0.rbi +8 -0
- data/sorbet/rbi/gems/stringio@3.0.2.rbi +8 -0
- data/sorbet/rbi/gems/sync@0.5.0.rbi +8 -0
- data/sorbet/rbi/gems/term-ansicolor@1.7.1.rbi +8 -0
- data/sorbet/rbi/gems/thor@1.2.1.rbi +3956 -0
- data/sorbet/rbi/gems/thread_safe@0.3.6.rbi +8 -0
- data/sorbet/rbi/gems/timecop@0.9.6.rbi +361 -0
- data/sorbet/rbi/gems/tins@1.32.1.rbi +8 -0
- data/sorbet/rbi/gems/tzinfo@2.0.6.rbi +5917 -0
- data/sorbet/rbi/gems/unicode-display_width@2.4.2.rbi +8 -0
- data/sorbet/rbi/gems/unparser@0.6.7.rbi +4515 -0
- data/sorbet/rbi/gems/webrick@1.7.0.rbi +2553 -0
- data/sorbet/rbi/gems/yard@0.9.28.rbi +17954 -0
- data/sorbet/rbi/gems/zeitwerk@2.6.7.rbi +966 -0
- data/sorbet/rbi/models/acts-as-messageable/message.rbi +668 -0
- data/sorbet/rbi/models/acts-as-messageable/user.rbi +343 -0
- data/sorbet/rbi/rails-rbi/active_record_base.rbi +119 -0
- data/sorbet/rbi/rails-rbi/active_record_relation.rbi +180 -0
- data/sorbet/rbi/shims/activerecord.rbi +4 -0
- data/sorbet/rbi/shims/model.rbi +9 -0
- data/sorbet/tapioca/config.yml +10 -0
- data/sorbet/tapioca/pre_require.rb +5 -0
- data/sorbet/tapioca/require.rb +10 -0
- data/spec/acts_as_messageable_spec.rb +7 -4
- data/spec/custom_class_spec.rb +1 -0
- data/spec/custom_required_spec.rb +8 -4
- data/spec/group_messages_spec.rb +1 -0
- data/spec/migrations_spec.rb +2 -1
- data/spec/spec_helper.rb +19 -9
- data/spec/support/admin.rb +3 -0
- data/spec/support/custom_message.rb +3 -0
- data/spec/support/custom_message_uuid.rb +1 -0
- data/spec/support/custom_search_user.rb +3 -0
- data/spec/support/men.rb +1 -0
- data/spec/support/send_message.rb +8 -1
- data/spec/support/table_schema.rb +7 -6
- data/spec/support/user.rb +3 -0
- data/spec/support/uuid_user.rb +3 -0
- data/tasks/types.rake +46 -0
- metadata +261 -11
- data/.travis.yml +0 -55
@@ -0,0 +1,455 @@
|
|
1
|
+
# typed: true
|
2
|
+
|
3
|
+
# DO NOT EDIT MANUALLY
|
4
|
+
# This is an autogenerated file for types exported from the `rails-dom-testing` gem.
|
5
|
+
# Please instead update this file by running `bin/tapioca gem rails-dom-testing`.
|
6
|
+
|
7
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb#4
|
8
|
+
class HTMLSelector
|
9
|
+
# @return [HTMLSelector] a new instance of HTMLSelector
|
10
|
+
#
|
11
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb#7
|
12
|
+
def initialize(values, previous_selection = T.unsafe(nil), &root_fallback); end
|
13
|
+
|
14
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb#33
|
15
|
+
def context; end
|
16
|
+
|
17
|
+
# Returns the value of attribute css_selector.
|
18
|
+
#
|
19
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb#5
|
20
|
+
def css_selector; end
|
21
|
+
|
22
|
+
# Returns the value of attribute message.
|
23
|
+
#
|
24
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb#5
|
25
|
+
def message; end
|
26
|
+
|
27
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb#25
|
28
|
+
def select; end
|
29
|
+
|
30
|
+
# @return [Boolean]
|
31
|
+
#
|
32
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb#19
|
33
|
+
def selecting_no_body?; end
|
34
|
+
|
35
|
+
# Returns the value of attribute tests.
|
36
|
+
#
|
37
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb#5
|
38
|
+
def tests; end
|
39
|
+
|
40
|
+
private
|
41
|
+
|
42
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb#87
|
43
|
+
def extract_equality_tests; end
|
44
|
+
|
45
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb#59
|
46
|
+
def extract_root(previous_selection, root_fallback); end
|
47
|
+
|
48
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb#76
|
49
|
+
def extract_selectors; end
|
50
|
+
|
51
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb#35
|
52
|
+
def filter(matches); end
|
53
|
+
|
54
|
+
class << self
|
55
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb#33
|
56
|
+
def context; end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/html_selector.rb#31
|
61
|
+
HTMLSelector::NO_STRIP = T.let(T.unsafe(nil), Array)
|
62
|
+
|
63
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions.rb#4
|
64
|
+
module Rails
|
65
|
+
class << self
|
66
|
+
# source://railties/7.0.4.1/lib/rails.rb#38
|
67
|
+
def app_class; end
|
68
|
+
|
69
|
+
# source://railties/7.0.4.1/lib/rails.rb#38
|
70
|
+
def app_class=(_arg0); end
|
71
|
+
|
72
|
+
# source://railties/7.0.4.1/lib/rails.rb#39
|
73
|
+
def application; end
|
74
|
+
|
75
|
+
# source://railties/7.0.4.1/lib/rails.rb#37
|
76
|
+
def application=(_arg0); end
|
77
|
+
|
78
|
+
# source://railties/7.0.4.1/lib/rails.rb#123
|
79
|
+
def autoloaders; end
|
80
|
+
|
81
|
+
# source://railties/7.0.4.1/lib/rails.rb#50
|
82
|
+
def backtrace_cleaner; end
|
83
|
+
|
84
|
+
# source://railties/7.0.4.1/lib/rails.rb#38
|
85
|
+
def cache; end
|
86
|
+
|
87
|
+
# source://railties/7.0.4.1/lib/rails.rb#38
|
88
|
+
def cache=(_arg0); end
|
89
|
+
|
90
|
+
# source://railties/7.0.4.1/lib/rails.rb#46
|
91
|
+
def configuration; end
|
92
|
+
|
93
|
+
# source://railties/7.0.4.1/lib/rails.rb#72
|
94
|
+
def env; end
|
95
|
+
|
96
|
+
# source://railties/7.0.4.1/lib/rails.rb#79
|
97
|
+
def env=(environment); end
|
98
|
+
|
99
|
+
# source://railties/7.0.4.1/lib/rails.rb#90
|
100
|
+
def error; end
|
101
|
+
|
102
|
+
# source://railties/7.0.4.1/lib/rails/gem_version.rb#5
|
103
|
+
def gem_version; end
|
104
|
+
|
105
|
+
# source://railties/7.0.4.1/lib/rails.rb#103
|
106
|
+
def groups(*groups); end
|
107
|
+
|
108
|
+
# source://railties/7.0.4.1/lib/rails.rb#43
|
109
|
+
def initialize!(*_arg0, **_arg1, &_arg2); end
|
110
|
+
|
111
|
+
# source://railties/7.0.4.1/lib/rails.rb#43
|
112
|
+
def initialized?(*_arg0, **_arg1, &_arg2); end
|
113
|
+
|
114
|
+
# source://railties/7.0.4.1/lib/rails.rb#38
|
115
|
+
def logger; end
|
116
|
+
|
117
|
+
# source://railties/7.0.4.1/lib/rails.rb#38
|
118
|
+
def logger=(_arg0); end
|
119
|
+
|
120
|
+
# source://railties/7.0.4.1/lib/rails.rb#119
|
121
|
+
def public_path; end
|
122
|
+
|
123
|
+
# source://railties/7.0.4.1/lib/rails.rb#63
|
124
|
+
def root; end
|
125
|
+
|
126
|
+
# source://railties/7.0.4.1/lib/rails/version.rb#7
|
127
|
+
def version; end
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions.rb#5
|
132
|
+
module Rails::Dom; end
|
133
|
+
|
134
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions.rb#6
|
135
|
+
module Rails::Dom::Testing; end
|
136
|
+
|
137
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions.rb#7
|
138
|
+
module Rails::Dom::Testing::Assertions
|
139
|
+
include ::Rails::Dom::Testing::Assertions::DomAssertions
|
140
|
+
include ::Rails::Dom::Testing::Assertions::SelectorAssertions::CountDescribable
|
141
|
+
include ::Rails::Dom::Testing::Assertions::SelectorAssertions
|
142
|
+
extend ::ActiveSupport::Concern
|
143
|
+
end
|
144
|
+
|
145
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/dom_assertions.rb#5
|
146
|
+
module Rails::Dom::Testing::Assertions::DomAssertions
|
147
|
+
# \Test two HTML strings for equivalency (e.g., equal even when attributes are in another order)
|
148
|
+
#
|
149
|
+
# # assert that the referenced method generates the appropriate HTML string
|
150
|
+
# assert_dom_equal '<a href="http://www.example.com">Apples</a>', link_to("Apples", "http://www.example.com")
|
151
|
+
#
|
152
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/dom_assertions.rb#10
|
153
|
+
def assert_dom_equal(expected, actual, message = T.unsafe(nil)); end
|
154
|
+
|
155
|
+
# The negated form of +assert_dom_equal+.
|
156
|
+
#
|
157
|
+
# # assert that the referenced method does not generate the specified HTML string
|
158
|
+
# assert_dom_not_equal '<a href="http://www.example.com">Apples</a>', link_to("Oranges", "http://www.example.com")
|
159
|
+
#
|
160
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/dom_assertions.rb#20
|
161
|
+
def assert_dom_not_equal(expected, actual, message = T.unsafe(nil)); end
|
162
|
+
|
163
|
+
protected
|
164
|
+
|
165
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/dom_assertions.rb#28
|
166
|
+
def compare_doms(expected, actual); end
|
167
|
+
|
168
|
+
# @return [Boolean]
|
169
|
+
#
|
170
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/dom_assertions.rb#63
|
171
|
+
def equal_attribute?(attr, other_attr); end
|
172
|
+
|
173
|
+
# @return [Boolean]
|
174
|
+
#
|
175
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/dom_assertions.rb#50
|
176
|
+
def equal_attribute_nodes?(nodes, other_nodes); end
|
177
|
+
|
178
|
+
# @return [Boolean]
|
179
|
+
#
|
180
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/dom_assertions.rb#38
|
181
|
+
def equal_children?(child, other_child); end
|
182
|
+
|
183
|
+
private
|
184
|
+
|
185
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/dom_assertions.rb#69
|
186
|
+
def fragment(text); end
|
187
|
+
end
|
188
|
+
|
189
|
+
# Adds the +assert_select+ method for use in Rails functional
|
190
|
+
# test cases, which can be used to make assertions on the response HTML of a controller
|
191
|
+
# action. You can also call +assert_select+ within another +assert_select+ to
|
192
|
+
# make assertions on elements selected by the enclosing assertion.
|
193
|
+
#
|
194
|
+
# Use +css_select+ to select elements without making an assertions, either
|
195
|
+
# from the response HTML or elements selected by the enclosing assertion.
|
196
|
+
#
|
197
|
+
# In addition to HTML responses, you can make the following assertions:
|
198
|
+
#
|
199
|
+
# * +assert_select_encoded+ - Assertions on HTML encoded inside XML, for example for dealing with feed item descriptions.
|
200
|
+
# * +assert_select_email+ - Assertions on the HTML body of an e-mail.
|
201
|
+
#
|
202
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/count_describable.rb#7
|
203
|
+
module Rails::Dom::Testing::Assertions::SelectorAssertions
|
204
|
+
include ::Rails::Dom::Testing::Assertions::SelectorAssertions::CountDescribable
|
205
|
+
|
206
|
+
# An assertion that selects elements and makes one or more equality tests.
|
207
|
+
#
|
208
|
+
# If the first argument is an element, selects all matching elements
|
209
|
+
# starting from (and including) that element and all its children in
|
210
|
+
# depth-first order.
|
211
|
+
#
|
212
|
+
# If no element is specified +assert_select+ selects from
|
213
|
+
# the element returned in +document_root_element+
|
214
|
+
# unless +assert_select+ is called from within an +assert_select+ block.
|
215
|
+
# Override +document_root_element+ to tell +assert_select+ what to select from.
|
216
|
+
# The default implementation raises an exception explaining this.
|
217
|
+
#
|
218
|
+
# When called with a block +assert_select+ passes an array of selected elements
|
219
|
+
# to the block. Calling +assert_select+ from the block, with no element specified,
|
220
|
+
# runs the assertion on the complete set of elements selected by the enclosing assertion.
|
221
|
+
# Alternatively the array may be iterated through so that +assert_select+ can be called
|
222
|
+
# separately for each element.
|
223
|
+
#
|
224
|
+
#
|
225
|
+
# ==== Example
|
226
|
+
# If the response contains two ordered lists, each with four list elements then:
|
227
|
+
# assert_select "ol" do |elements|
|
228
|
+
# elements.each do |element|
|
229
|
+
# assert_select element, "li", 4
|
230
|
+
# end
|
231
|
+
# end
|
232
|
+
#
|
233
|
+
# will pass, as will:
|
234
|
+
# assert_select "ol" do
|
235
|
+
# assert_select "li", 8
|
236
|
+
# end
|
237
|
+
#
|
238
|
+
# The selector may be a CSS selector expression (String) or an expression
|
239
|
+
# with substitution values (Array).
|
240
|
+
# Substitution uses a custom pseudo class match. Pass in whatever attribute you want to match (enclosed in quotes) and a ? for the substitution.
|
241
|
+
# assert_select returns nil if called with an invalid css selector.
|
242
|
+
#
|
243
|
+
# assert_select "div:match('id', ?)", /\d+/
|
244
|
+
#
|
245
|
+
# === Equality Tests
|
246
|
+
#
|
247
|
+
# The equality test may be one of the following:
|
248
|
+
# * <tt>true</tt> - Assertion is true if at least one element selected.
|
249
|
+
# * <tt>false</tt> - Assertion is true if no element selected.
|
250
|
+
# * <tt>String/Regexp</tt> - Assertion is true if the text value of at least
|
251
|
+
# one element matches the string or regular expression.
|
252
|
+
# * <tt>Integer</tt> - Assertion is true if exactly that number of
|
253
|
+
# elements are selected.
|
254
|
+
# * <tt>Range</tt> - Assertion is true if the number of selected
|
255
|
+
# elements fit the range.
|
256
|
+
# If no equality test specified, the assertion is true if at least one
|
257
|
+
# element selected.
|
258
|
+
#
|
259
|
+
# To perform more than one equality tests, use a hash with the following keys:
|
260
|
+
# * <tt>:text</tt> - Narrow the selection to elements that have this text
|
261
|
+
# value (string or regexp).
|
262
|
+
# * <tt>:html</tt> - Narrow the selection to elements that have this HTML
|
263
|
+
# content (string or regexp).
|
264
|
+
# * <tt>:count</tt> - Assertion is true if the number of selected elements
|
265
|
+
# is equal to this value.
|
266
|
+
# * <tt>:minimum</tt> - Assertion is true if the number of selected
|
267
|
+
# elements is at least this value.
|
268
|
+
# * <tt>:maximum</tt> - Assertion is true if the number of selected
|
269
|
+
# elements is at most this value.
|
270
|
+
#
|
271
|
+
# If the method is called with a block, once all equality tests are
|
272
|
+
# evaluated the block is called with an array of all matched elements.
|
273
|
+
#
|
274
|
+
# # At least one form element
|
275
|
+
# assert_select "form"
|
276
|
+
#
|
277
|
+
# # Form element includes four input fields
|
278
|
+
# assert_select "form input", 4
|
279
|
+
#
|
280
|
+
# # Page title is "Welcome"
|
281
|
+
# assert_select "title", "Welcome"
|
282
|
+
#
|
283
|
+
# # Page title is "Welcome" and there is only one title element
|
284
|
+
# assert_select "title", {count: 1, text: "Welcome"},
|
285
|
+
# "Wrong title or more than one title element"
|
286
|
+
#
|
287
|
+
# # Page contains no forms
|
288
|
+
# assert_select "form", false, "This page must contain no forms"
|
289
|
+
#
|
290
|
+
# # Test the content and style
|
291
|
+
# assert_select "body div.header ul.menu"
|
292
|
+
#
|
293
|
+
# # Use substitution values
|
294
|
+
# assert_select "ol>li:match('id', ?)", /item-\d+/
|
295
|
+
#
|
296
|
+
# # All input fields in the form have a name
|
297
|
+
# assert_select "form input" do
|
298
|
+
# assert_select ":match('name', ?)", /.+/ # Not empty
|
299
|
+
# end
|
300
|
+
#
|
301
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions.rb#161
|
302
|
+
def assert_select(*args, &block); end
|
303
|
+
|
304
|
+
# Extracts the body of an email and runs nested assertions on it.
|
305
|
+
#
|
306
|
+
# You must enable deliveries for this assertion to work, use:
|
307
|
+
# ActionMailer::Base.perform_deliveries = true
|
308
|
+
#
|
309
|
+
# assert_select_email do
|
310
|
+
# assert_select "h1", "Email alert"
|
311
|
+
# end
|
312
|
+
#
|
313
|
+
# assert_select_email do
|
314
|
+
# items = assert_select "ol>li"
|
315
|
+
# items.each do
|
316
|
+
# # Work with items here...
|
317
|
+
# end
|
318
|
+
# end
|
319
|
+
#
|
320
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions.rb#247
|
321
|
+
def assert_select_email(&block); end
|
322
|
+
|
323
|
+
# Extracts the content of an element, treats it as encoded HTML and runs
|
324
|
+
# nested assertion on it.
|
325
|
+
#
|
326
|
+
# You typically call this method within another assertion to operate on
|
327
|
+
# all currently selected elements. You can also pass an element or array
|
328
|
+
# of elements.
|
329
|
+
#
|
330
|
+
# The content of each element is un-encoded, and wrapped in the root
|
331
|
+
# element +encoded+. It then calls the block with all un-encoded elements.
|
332
|
+
#
|
333
|
+
# # Selects all bold tags from within the title of an Atom feed's entries (perhaps to nab a section name prefix)
|
334
|
+
# assert_select "feed[xmlns='http://www.w3.org/2005/Atom']" do
|
335
|
+
# # Select each entry item and then the title item
|
336
|
+
# assert_select "entry>title" do
|
337
|
+
# # Run assertions on the encoded title elements
|
338
|
+
# assert_select_encoded do
|
339
|
+
# assert_select "b"
|
340
|
+
# end
|
341
|
+
# end
|
342
|
+
# end
|
343
|
+
#
|
344
|
+
#
|
345
|
+
# # Selects all paragraph tags from within the description of an RSS feed
|
346
|
+
# assert_select "rss[version=2.0]" do
|
347
|
+
# # Select description element of each feed item.
|
348
|
+
# assert_select "channel>item>description" do
|
349
|
+
# # Run assertions on the encoded elements.
|
350
|
+
# assert_select_encoded do
|
351
|
+
# assert_select "p"
|
352
|
+
# end
|
353
|
+
# end
|
354
|
+
# end
|
355
|
+
#
|
356
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions.rb#211
|
357
|
+
def assert_select_encoded(element = T.unsafe(nil), &block); end
|
358
|
+
|
359
|
+
# Select and return all matching elements.
|
360
|
+
#
|
361
|
+
# If called with a single argument, uses that argument as a selector.
|
362
|
+
# Called without an element +css_select+ selects from
|
363
|
+
# the element returned in +document_root_element+
|
364
|
+
#
|
365
|
+
# The default implementation of +document_root_element+ raises an exception explaining this.
|
366
|
+
#
|
367
|
+
# Returns an empty Nokogiri::XML::NodeSet if no match is found.
|
368
|
+
#
|
369
|
+
# If called with two arguments, uses the first argument as the root
|
370
|
+
# element and the second argument as the selector. Attempts to match the
|
371
|
+
# root element and any of its children.
|
372
|
+
# Returns an empty Nokogiri::XML::NodeSet if no match is found.
|
373
|
+
#
|
374
|
+
# The selector may be a CSS selector expression (String).
|
375
|
+
# css_select returns nil if called with an invalid css selector.
|
376
|
+
#
|
377
|
+
# # Selects all div tags
|
378
|
+
# divs = css_select("div")
|
379
|
+
#
|
380
|
+
# # Selects all paragraph tags and does something interesting
|
381
|
+
# pars = css_select("p")
|
382
|
+
# pars.each do |par|
|
383
|
+
# # Do something fun with paragraphs here...
|
384
|
+
# end
|
385
|
+
#
|
386
|
+
# # Selects all list items in unordered lists
|
387
|
+
# items = css_select("ul>li")
|
388
|
+
#
|
389
|
+
# # Selects all form tags and then all inputs inside the form
|
390
|
+
# forms = css_select("form")
|
391
|
+
# forms.each do |form|
|
392
|
+
# inputs = css_select(form, "input")
|
393
|
+
# ...
|
394
|
+
# end
|
395
|
+
#
|
396
|
+
# @raise [ArgumentError]
|
397
|
+
#
|
398
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions.rb#59
|
399
|
+
def css_select(*args); end
|
400
|
+
|
401
|
+
private
|
402
|
+
|
403
|
+
# +equals+ must contain :minimum, :maximum and :count keys
|
404
|
+
#
|
405
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions.rb#270
|
406
|
+
def assert_size_match!(size, equals, css_selector, message = T.unsafe(nil)); end
|
407
|
+
|
408
|
+
# @raise [NotImplementedError]
|
409
|
+
#
|
410
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions.rb#264
|
411
|
+
def document_root_element; end
|
412
|
+
|
413
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions.rb#282
|
414
|
+
def nest_selection(selection); end
|
415
|
+
|
416
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions.rb#291
|
417
|
+
def nodeset(node); end
|
418
|
+
end
|
419
|
+
|
420
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/count_describable.rb#8
|
421
|
+
module Rails::Dom::Testing::Assertions::SelectorAssertions::CountDescribable
|
422
|
+
extend ::ActiveSupport::Concern
|
423
|
+
|
424
|
+
private
|
425
|
+
|
426
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/count_describable.rb#12
|
427
|
+
def count_description(min, max, count); end
|
428
|
+
|
429
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/count_describable.rb#24
|
430
|
+
def pluralize_element(quantity); end
|
431
|
+
end
|
432
|
+
|
433
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/substitution_context.rb#1
|
434
|
+
class SubstitutionContext
|
435
|
+
# @return [SubstitutionContext] a new instance of SubstitutionContext
|
436
|
+
#
|
437
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/substitution_context.rb#2
|
438
|
+
def initialize; end
|
439
|
+
|
440
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/substitution_context.rb#16
|
441
|
+
def match(matches, attribute, matcher); end
|
442
|
+
|
443
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/substitution_context.rb#6
|
444
|
+
def substitute!(selector, values, format_for_presentation = T.unsafe(nil)); end
|
445
|
+
|
446
|
+
private
|
447
|
+
|
448
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/substitution_context.rb#21
|
449
|
+
def matcher_for(value, format_for_presentation); end
|
450
|
+
|
451
|
+
# @return [Boolean]
|
452
|
+
#
|
453
|
+
# source://rails-dom-testing//lib/rails/dom/testing/assertions/selector_assertions/substitution_context.rb#30
|
454
|
+
def substitutable?(value); end
|
455
|
+
end
|