rspec-rails 2.99.0 → 3.0.0.beta1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. checksums.yaml +8 -8
  2. checksums.yaml.gz.sig +2 -0
  3. data.tar.gz.sig +0 -0
  4. data/Changelog.md +40 -68
  5. data/License.txt +1 -0
  6. data/README.md +6 -4
  7. data/features/Generators.md +24 -0
  8. data/features/GettingStarted.md +84 -0
  9. data/features/README.md +56 -0
  10. data/features/RailsVersions.md +4 -0
  11. data/features/Transactions.md +84 -0
  12. data/features/Upgrade.md +121 -0
  13. data/features/controller_specs/Cookies.md +57 -0
  14. data/features/controller_specs/README.md +45 -0
  15. data/features/controller_specs/anonymous_controller.feature +378 -0
  16. data/features/controller_specs/bypass_rescue.feature +75 -0
  17. data/features/controller_specs/controller_spec.feature +58 -0
  18. data/features/controller_specs/engine_routes.feature +51 -0
  19. data/features/controller_specs/isolation_from_views.feature +87 -0
  20. data/features/controller_specs/render_views.feature +114 -0
  21. data/features/directory_structure.feature +71 -0
  22. data/features/feature_specs/feature_spec.feature +35 -0
  23. data/features/helper_specs/helper_spec.feature +122 -0
  24. data/features/mailer_specs/url_helpers.feature +38 -0
  25. data/features/matchers/README.md +18 -0
  26. data/features/matchers/new_record_matcher.feature +41 -0
  27. data/features/matchers/redirect_to_matcher.feature +40 -0
  28. data/features/matchers/relation_match_array.feature +27 -0
  29. data/features/matchers/render_template_matcher.feature +49 -0
  30. data/features/mocks/mock_model.feature +147 -0
  31. data/features/mocks/stub_model.feature +58 -0
  32. data/features/model_specs/README.md +21 -0
  33. data/features/model_specs/errors_on.feature +51 -0
  34. data/features/model_specs/records.feature +27 -0
  35. data/features/model_specs/transactional_examples.feature +109 -0
  36. data/features/request_specs/request_spec.feature +49 -0
  37. data/features/routing_specs/README.md +16 -0
  38. data/features/routing_specs/be_routable_matcher.feature +80 -0
  39. data/features/routing_specs/engine_routes.feature +38 -0
  40. data/features/routing_specs/named_routes.feature +18 -0
  41. data/features/routing_specs/route_to_matcher.feature +90 -0
  42. data/features/step_definitions/additional_cli_steps.rb +4 -0
  43. data/features/step_definitions/model_steps.rb +3 -0
  44. data/features/support/capybara.rb +7 -0
  45. data/features/support/env.rb +53 -0
  46. data/features/support/rails_versions.rb +4 -0
  47. data/features/support/rubinius.rb +6 -0
  48. data/features/view_specs/inferred_controller_path.feature +45 -0
  49. data/features/view_specs/stub_template.feature +51 -0
  50. data/features/view_specs/view_spec.feature +206 -0
  51. data/lib/generators/rspec/controller/templates/controller_spec.rb +1 -1
  52. data/lib/generators/rspec/install/templates/spec/spec_helper.rb.tt +2 -21
  53. data/lib/generators/rspec/integration/integration_generator.rb +2 -3
  54. data/lib/generators/rspec/integration/templates/request_spec.rb +1 -1
  55. data/lib/generators/rspec/mailer/templates/mailer_spec.rb +4 -4
  56. data/lib/generators/rspec/scaffold/scaffold_generator.rb +2 -3
  57. data/lib/generators/rspec/scaffold/templates/controller_spec.rb +16 -16
  58. data/lib/generators/rspec/scaffold/templates/edit_spec.rb +2 -2
  59. data/lib/generators/rspec/scaffold/templates/index_spec.rb +1 -1
  60. data/lib/generators/rspec/scaffold/templates/new_spec.rb +2 -2
  61. data/lib/generators/rspec/scaffold/templates/routing_spec.rb +7 -7
  62. data/lib/generators/rspec/scaffold/templates/show_spec.rb +2 -2
  63. data/lib/rspec/rails.rb +0 -5
  64. data/lib/rspec/rails/adapters.rb +5 -12
  65. data/lib/rspec/rails/example.rb +55 -24
  66. data/lib/rspec/rails/example/controller_example_group.rb +7 -31
  67. data/lib/rspec/rails/example/view_example_group.rb +0 -3
  68. data/lib/rspec/rails/matchers.rb +1 -2
  69. data/lib/rspec/rails/matchers/be_a_new.rb +1 -1
  70. data/lib/rspec/rails/matchers/be_new_record.rb +1 -1
  71. data/lib/rspec/rails/matchers/be_valid.rb +1 -1
  72. data/lib/rspec/rails/matchers/have_rendered.rb +1 -1
  73. data/lib/rspec/rails/matchers/redirect_to.rb +1 -1
  74. data/lib/rspec/rails/matchers/relation_match_array.rb +1 -1
  75. data/lib/rspec/rails/matchers/routing_matchers.rb +6 -10
  76. data/lib/rspec/rails/mocks.rb +5 -41
  77. data/lib/rspec/rails/tasks/rspec.rake +5 -12
  78. data/lib/rspec/rails/vendor/capybara.rb +4 -35
  79. data/lib/rspec/rails/version.rb +1 -1
  80. data/spec/generators/rspec/controller/controller_generator_spec.rb +97 -0
  81. data/spec/generators/rspec/helper/helper_generator_spec.rb +30 -0
  82. data/spec/generators/rspec/install/install_generator_spec.rb +30 -0
  83. data/spec/generators/rspec/integration/integration_generator_spec.rb +44 -0
  84. data/spec/generators/rspec/mailer/mailer_generator_spec.rb +48 -0
  85. data/spec/generators/rspec/model/model_generator_spec.rb +52 -0
  86. data/spec/generators/rspec/observer/observer_generator_spec.rb +21 -0
  87. data/spec/generators/rspec/scaffold/scaffold_generator_spec.rb +138 -0
  88. data/spec/generators/rspec/view/view_generator_spec.rb +41 -0
  89. data/spec/rspec/rails/assertion_adapter_spec.rb +28 -0
  90. data/spec/rspec/rails/assertion_delegator_spec.rb +43 -0
  91. data/spec/rspec/rails/configuration_spec.rb +26 -0
  92. data/spec/rspec/rails/deprecations_spec.rb +18 -0
  93. data/spec/rspec/rails/example/controller_example_group_spec.rb +100 -0
  94. data/spec/rspec/rails/example/feature_example_group_spec.rb +56 -0
  95. data/spec/rspec/rails/example/helper_example_group_spec.rb +66 -0
  96. data/spec/rspec/rails/example/mailer_example_group_spec.rb +21 -0
  97. data/spec/rspec/rails/example/model_example_group_spec.rb +15 -0
  98. data/spec/rspec/rails/example/request_example_group_spec.rb +17 -0
  99. data/spec/rspec/rails/example/routing_example_group_spec.rb +32 -0
  100. data/spec/rspec/rails/example/view_example_group_spec.rb +220 -0
  101. data/spec/rspec/rails/extensions/active_model/errors_on_spec.rb +23 -0
  102. data/spec/rspec/rails/extensions/active_record/base_spec.rb +42 -0
  103. data/spec/rspec/rails/fixture_support_spec.rb +17 -0
  104. data/spec/rspec/rails/matchers/be_a_new_spec.rb +142 -0
  105. data/spec/rspec/rails/matchers/be_new_record_spec.rb +33 -0
  106. data/spec/rspec/rails/matchers/be_routable_spec.rb +41 -0
  107. data/spec/rspec/rails/matchers/be_valid_spec.rb +44 -0
  108. data/spec/rspec/rails/matchers/has_spec.rb +29 -0
  109. data/spec/rspec/rails/matchers/have_rendered_spec.rb +93 -0
  110. data/spec/rspec/rails/matchers/redirect_to_spec.rb +80 -0
  111. data/spec/rspec/rails/matchers/relation_match_array_spec.rb +31 -0
  112. data/spec/rspec/rails/matchers/route_to_spec.rb +151 -0
  113. data/spec/rspec/rails/minitest_lifecycle_adapter_spec.rb +22 -0
  114. data/spec/rspec/rails/mocks/mock_model_spec.rb +378 -0
  115. data/spec/rspec/rails/mocks/stub_model_spec.rb +154 -0
  116. data/spec/rspec/rails/setup_and_teardown_adapter_spec.rb +32 -0
  117. data/spec/rspec/rails/view_rendering_spec.rb +111 -0
  118. data/spec/spec_helper.rb +35 -0
  119. data/spec/support/ar_classes.rb +42 -0
  120. data/spec/support/helpers.rb +20 -0
  121. data/spec/support/matchers.rb +9 -0
  122. data/spec/support/null_object.rb +6 -0
  123. metadata +229 -42
  124. metadata.gz.sig +0 -0
  125. data/lib/autotest/rails_rspec2.rb +0 -91
  126. data/lib/rspec/rails/infer_type_configuration.rb +0 -26
  127. data/lib/rspec/rails/matchers/have_extension.rb +0 -36
  128. data/lib/rspec/rails/module_inclusion.rb +0 -19
@@ -0,0 +1,58 @@
1
+ Feature: stub_model
2
+
3
+ The stub_model method generates an instance of a Active Model model.
4
+
5
+ While you can use stub_model in any example (model, view, controller,
6
+ helper), it is especially useful in view examples, which are inherently
7
+ more state-based than interaction-based.
8
+
9
+ Scenario: passing an Active Record constant with a hash of stubs
10
+ Given a file named "spec/models/widget_spec.rb" with:
11
+ """ruby
12
+ require "spec_helper"
13
+
14
+ describe "stub_model(Widget) with a hash of stubs" do
15
+ let(:widget) do
16
+ stub_model Widget, :id => 5, :random_attribute => true
17
+ end
18
+
19
+ it "stubs :id" do
20
+ expect(widget.id).to eql(5)
21
+ end
22
+
23
+ it "stubs :random_attribute" do
24
+ expect(widget.random_attribute).to be_truthy
25
+ end
26
+
27
+ it "returns false for new_record? if :id is set" do
28
+ expect(widget).not_to be_new_record
29
+ end
30
+
31
+ it "can be converted to a new record" do
32
+ widget.as_new_record
33
+ expect(widget).to be_new_record
34
+ end
35
+ end
36
+ """
37
+ When I run `rspec spec/models/widget_spec.rb`
38
+ Then the examples should all pass
39
+
40
+ Scenario: passing an Active Record constant with a block of stubs
41
+ Given a file named "spec/models/widget_spec.rb" with:
42
+ """ruby
43
+ require "spec_helper"
44
+
45
+ describe "stub_model(Widget) with a block of stubs" do
46
+ let(:widget) do
47
+ stub_model Widget do |widget|
48
+ widget.id = 5
49
+ end
50
+ end
51
+
52
+ it "stubs :id" do
53
+ expect(widget.id).to eql(5)
54
+ end
55
+ end
56
+ """
57
+ When I run `rspec spec/models/widget_spec.rb`
58
+ Then the examples should all pass
@@ -0,0 +1,21 @@
1
+ Model specs live in `spec/models` or any example group with
2
+ `:type => :model`.
3
+
4
+ A model spec is a thin wrapper for an ActiveSupport::TestCase, and includes all
5
+ of the behavior and assertions that it provides, in addition to RSpec's own
6
+ behavior and expectations.
7
+
8
+ ## Examples
9
+
10
+ require "spec_helper"
11
+
12
+ describe Post do
13
+ context "with 2 or more comments" do
14
+ it "orders them in reverse chronologically" do
15
+ post = Post.create!
16
+ comment1 = post.comments.create!(:body => "first comment")
17
+ comment2 = post.comments.create!(:body => "second comment")
18
+ expect(post.reload.comments).to eq([comment2, comment1])
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,51 @@
1
+ Feature: errors_on
2
+
3
+ Scenario: with one validation error
4
+ Given a file named "spec/models/widget_spec.rb" with:
5
+ """ruby
6
+ require "spec_helper"
7
+
8
+ class ValidatingWidget < ActiveRecord::Base
9
+ self.table_name = :widgets
10
+ validates_presence_of :name
11
+
12
+ # In Rails 4, mass assignment protection is implemented on controllers
13
+ attr_accessible :name if ::ActiveRecord::VERSION::STRING < '4'
14
+
15
+ validates_length_of :name, :minimum => 10, :on => :publication
16
+ end
17
+
18
+ describe ValidatingWidget do
19
+ it "fails validation with no name (using error_on)" do
20
+ expect(ValidatingWidget.new).to have(1).error_on(:name)
21
+ end
22
+
23
+ it "fails validation with no name (using errors_on)" do
24
+ expect(ValidatingWidget.new).to have(1).errors_on(:name)
25
+ end
26
+
27
+ it "fails validation with no name expecting a specific message" do
28
+ expect(ValidatingWidget.new.errors_on(:name)).to include("can't be blank")
29
+ end
30
+
31
+ it "fails validation with a short name (using a validation context)" do
32
+ expect(ValidatingWidget.new(:name => "too short")).
33
+ to have(1).errors_on(:name, :context => :publication)
34
+ end
35
+
36
+ it "passes validation with a longer name (using a validation context)" do
37
+ expect(ValidatingWidget.new(:name => "a longer name")).
38
+ to have(0).errors_on(:name, :context => :publication)
39
+ end
40
+
41
+ it "passes validation with a name (using 0)" do
42
+ expect(ValidatingWidget.new(:name => "liquid nitrogen")).to have(0).errors_on(:name)
43
+ end
44
+
45
+ it "passes validation with a name (using :no)" do
46
+ expect(ValidatingWidget.new(:name => "liquid nitrogen")).to have(:no).errors_on(:name)
47
+ end
48
+ end
49
+ """
50
+ When I run `rspec spec/models/widget_spec.rb`
51
+ Then the examples should all pass
@@ -0,0 +1,27 @@
1
+ Feature: records
2
+
3
+ Scenario: asserting number of records
4
+ Given a file named "spec/models/widget_spec.rb" with:
5
+ """ruby
6
+ require "spec_helper"
7
+
8
+ describe Widget do
9
+ it "has no widgets in the database" do
10
+ expect(Widget).to have(:no).records
11
+ expect(Widget).to have(0).records
12
+ end
13
+
14
+ it "has one record" do
15
+ Widget.create!(:name => "Cog")
16
+ expect(Widget).to have(1).record
17
+ end
18
+
19
+ it "counts only records that match a query" do
20
+ Widget.create!(:name => "Cog")
21
+ expect(Widget.where(:name => "Cog")).to have(1).record
22
+ expect(Widget.where(:name => "Wheel")).to have(0).records
23
+ end
24
+ end
25
+ """
26
+ When I run `rspec spec/models/widget_spec.rb`
27
+ Then the examples should all pass
@@ -0,0 +1,109 @@
1
+ Feature: transactional examples
2
+
3
+ By default rspec executes each individual example in a transaction.
4
+
5
+ You can also explicitly enable/disable transactions the configuration
6
+ property 'use_transactional_examples'.
7
+
8
+ Scenario: run in transactions (default)
9
+ Given a file named "spec/models/widget_spec.rb" with:
10
+ """ruby
11
+ require "spec_helper"
12
+
13
+ describe Widget do
14
+ it "has none to begin with" do
15
+ expect(Widget.count).to eq 0
16
+ end
17
+
18
+ it "has one after adding one" do
19
+ Widget.create
20
+ expect(Widget.count).to eq 1
21
+ end
22
+
23
+ it "has none after one was created in a previous example" do
24
+ expect(Widget.count).to eq 0
25
+ end
26
+ end
27
+ """
28
+ When I run `rspec spec/models/widget_spec.rb`
29
+ Then the examples should all pass
30
+
31
+ Scenario: run in transactions (explicit)
32
+ Given a file named "spec/models/widget_spec.rb" with:
33
+ """ruby
34
+ require "spec_helper"
35
+
36
+ RSpec.configure do |c|
37
+ c.use_transactional_examples = true
38
+ end
39
+
40
+ describe Widget do
41
+ it "has none to begin with" do
42
+ expect(Widget.count).to eq 0
43
+ end
44
+
45
+ it "has one after adding one" do
46
+ Widget.create
47
+ expect(Widget.count).to eq 1
48
+ end
49
+
50
+ it "has none after one was created in a previous example" do
51
+ expect(Widget.count).to eq 0
52
+ end
53
+ end
54
+ """
55
+ When I run `rspec spec/models/widget_spec.rb`
56
+ Then the examples should all pass
57
+
58
+ Scenario: disable transactions (explicit)
59
+ Given a file named "spec/models/widget_spec.rb" with:
60
+ """ruby
61
+ require "spec_helper"
62
+
63
+ RSpec.configure do |c|
64
+ c.use_transactional_examples = false
65
+ c.order = "defined"
66
+ end
67
+
68
+ describe Widget do
69
+ it "has none to begin with" do
70
+ expect(Widget.count).to eq 0
71
+ end
72
+
73
+ it "has one after adding one" do
74
+ Widget.create
75
+ expect(Widget.count).to eq 1
76
+ end
77
+
78
+ it "has one after one was created in a previous example" do
79
+ expect(Widget.count).to eq 1
80
+ end
81
+
82
+ after(:all) { Widget.destroy_all }
83
+ end
84
+ """
85
+ When I run `rspec spec/models/widget_spec.rb`
86
+ Then the examples should all pass
87
+
88
+ Scenario: run in transactions with fixture
89
+ Given a file named "spec/models/thing_spec.rb" with:
90
+ """ruby
91
+ require "spec_helper"
92
+
93
+ describe Thing do
94
+ fixtures :things
95
+ it "fixture method defined" do
96
+ things(:one)
97
+ end
98
+ end
99
+ """
100
+ Given a file named "spec/fixtures/things.yml" with:
101
+ """
102
+ one:
103
+ name: MyString
104
+ """
105
+ When I run `rspec spec/models/thing_spec.rb`
106
+ Then the examples should all pass
107
+
108
+
109
+
@@ -0,0 +1,49 @@
1
+ Feature: request spec
2
+
3
+ Request specs provide a thin wrapper around Rails' integration tests, and are
4
+ designed to drive behavior through the full stack, including routing
5
+ (provided by Rails) and without stubbing (that's up to you).
6
+
7
+ With request specs, you can:
8
+
9
+ * specify a single request
10
+ * specify multiple requests across multiple controllers
11
+ * specify multiple requests across multiple sessions
12
+
13
+ Check the rails documentation on integration tests for more information.
14
+
15
+ RSpec provides two matchers that delegate to Rails assertions:
16
+
17
+ render_template # delegates to assert_template
18
+ redirect_to # delegates to assert_redirected_to
19
+
20
+ Check the Rails docs for details on these methods as well.
21
+
22
+ [Capybara](http://github.com/jnicklas/capybara) is no longer supported in
23
+ request specs as of Capybara 2.0.0. The recommended way to use Capybara is
24
+ with [feature specs](../feature-specs/feature-spec).
25
+
26
+ Scenario: specify managing a Widget with Rails integration methods
27
+ Given a file named "spec/requests/widget_management_spec.rb" with:
28
+ """ruby
29
+ require "spec_helper"
30
+
31
+ describe "Widget management" do
32
+
33
+ it "creates a Widget and redirects to the Widget's page" do
34
+ get "/widgets/new"
35
+ expect(response).to render_template(:new)
36
+
37
+ post "/widgets", :widget => {:name => "My Widget"}
38
+
39
+ expect(response).to redirect_to(assigns(:widget))
40
+ follow_redirect!
41
+
42
+ expect(response).to render_template(:show)
43
+ expect(response.body).to include("Widget was successfully created.")
44
+ end
45
+
46
+ end
47
+ """
48
+ When I run `rspec spec/requests/widget_management_spec.rb`
49
+ Then the example should pass
@@ -0,0 +1,16 @@
1
+ Routing specs live in the `spec/routing` directory, or any example group with
2
+ `:type => :routing`.
3
+
4
+ Simple apps with nothing but standard RESTful routes won't get much value from
5
+ routing specs, but they can provide significant value when used to specify
6
+ customized routes, like vanity links, slugs, etc.
7
+
8
+ expect(:get => "/articles/2012/11/when-to-use-routing-specs").to route_to(
9
+ :controller => "articles",
10
+ :month => "2012-11",
11
+ :slug => "when-to-use-routing-specs"
12
+ )
13
+
14
+ They are also valuable for routes that should not be available:
15
+
16
+ expect(:delete => "/accounts/37").not_to be_routable
@@ -0,0 +1,80 @@
1
+ Feature: be_routable matcher
2
+
3
+ The `be_routable` matcher is best used with `should_not` to specify that a
4
+ given route should not be routable. It is available in routing specs (in
5
+ spec/routing) and controller specs (in spec/controllers).
6
+
7
+ Scenario: specify routeable route should not be routable (fails)
8
+ Given a file named "spec/routing/widgets_routing_spec.rb" with:
9
+ """ruby
10
+ require "spec_helper"
11
+
12
+ describe "routes for Widgets" do
13
+ it "does not route to widgets" do
14
+ expect(:get => "/widgets").not_to be_routable
15
+ end
16
+ end
17
+ """
18
+
19
+ When I run `rspec spec/routing/widgets_routing_spec.rb`
20
+ Then the output should contain "1 example, 1 failure"
21
+
22
+ Scenario: specify non-routeable route should not be routable (passes)
23
+ Given a file named "spec/routing/widgets_routing_spec.rb" with:
24
+ """ruby
25
+ require "spec_helper"
26
+
27
+ describe "routes for Widgets" do
28
+ it "does not route to widgets/foo/bar" do
29
+ expect(:get => "/widgets/foo/bar").not_to be_routable
30
+ end
31
+ end
32
+ """
33
+
34
+ When I run `rspec spec/routing/widgets_routing_spec.rb`
35
+ Then the examples should all pass
36
+
37
+ Scenario: specify routeable route should be routable (passes)
38
+ Given a file named "spec/routing/widgets_routing_spec.rb" with:
39
+ """ruby
40
+ require "spec_helper"
41
+
42
+ describe "routes for Widgets" do
43
+ it "routes to /widgets" do
44
+ expect(:get => "/widgets").to be_routable
45
+ end
46
+ end
47
+ """
48
+
49
+ When I run `rspec spec/routing/widgets_routing_spec.rb`
50
+ Then the examples should all pass
51
+
52
+ Scenario: specify non-routeable route should be routable (fails)
53
+ Given a file named "spec/routing/widgets_routing_spec.rb" with:
54
+ """ruby
55
+ require "spec_helper"
56
+
57
+ describe "routes for Widgets" do
58
+ it "routes to widgets/foo/bar" do
59
+ expect(:get => "/widgets/foo/bar").to be_routable
60
+ end
61
+ end
62
+ """
63
+
64
+ When I run `rspec spec/routing/widgets_routing_spec.rb`
65
+ Then the output should contain "1 example, 1 failure"
66
+
67
+ Scenario: be_routable in a controller spec
68
+ Given a file named "spec/controllers/widgets_controller_spec.rb" with:
69
+ """ruby
70
+ require "spec_helper"
71
+
72
+ describe WidgetsController do
73
+ it "routes to /widgets" do
74
+ expect(:get => "/widgets").to be_routable
75
+ end
76
+ end
77
+ """
78
+
79
+ When I run `rspec spec/controllers/widgets_controller_spec.rb`
80
+ Then the examples should all pass
@@ -0,0 +1,38 @@
1
+ Feature: engine routes
2
+
3
+ Routing specs can specify the routeset that will be used for the example
4
+ group. This is most useful when testing Rails engines.
5
+
6
+ @unsupported-on-rails-3-0
7
+ Scenario: specify engine route
8
+ Given a file named "spec/routing/engine_routes_spec.rb" with:
9
+ """ruby
10
+ require "spec_helper"
11
+
12
+ # A very simple Rails engine
13
+ module MyEngine
14
+ class Engine < ::Rails::Engine
15
+ isolate_namespace MyEngine
16
+ end
17
+
18
+ Engine.routes.draw do
19
+ resources :widgets, :only => [:index]
20
+ end
21
+
22
+ class WidgetsController < ::ActionController::Base
23
+ def index
24
+ end
25
+ end
26
+ end
27
+
28
+ describe MyEngine::WidgetsController do
29
+ routes { MyEngine::Engine.routes }
30
+
31
+ it "routes to the list of all widgets" do
32
+ expect(:get => widgets_path).
33
+ to route_to(:controller => "my_engine/widgets", :action => "index")
34
+ end
35
+ end
36
+ """
37
+ When I run `rspec spec`
38
+ Then the examples should all pass