File tree Expand file tree Collapse file tree 2 files changed +15
-15
lines changed Expand file tree Collapse file tree 2 files changed +15
-15
lines changed Original file line number Diff line number Diff line change 1
1
require 'spec_helper'
2
2
require 'support/editor'
3
+ require 'support/matchers/be_at_url'
3
4
require 'support/playground_actions'
4
5
5
6
RSpec . feature "Navigating between pages" , type : :feature , js : true do
6
7
include PlaygroundActions
7
8
8
- RSpec ::Matchers . define :be_at_url do |path , query = { } |
9
- match do |page |
10
- uri = URI ::parse ( page . current_url )
11
- expect ( uri . path ) . to eql ( path )
12
-
13
- query = query . map { |k , v | [ k . to_s , Array ( v ) . map ( &:to_s ) ] } . to_h
14
- query_hash = CGI ::parse ( uri . query || '' )
15
- expect ( query_hash ) . to include ( query )
16
- end
17
-
18
- failure_message do |page |
19
- "expected that #{ page . current_url } would be #{ path } with the query parameters #{ query } "
20
- end
21
- end
22
-
23
9
# This is kind of a test of the router library too, so if that ever
24
10
# gets extracted, a chunk of these tests can be removed.
25
11
Original file line number Diff line number Diff line change
1
+ RSpec ::Matchers . define :be_at_url do |path , query = { } |
2
+ match do |page |
3
+ uri = URI ::parse ( page . current_url )
4
+ expect ( uri . path ) . to eql ( path )
5
+
6
+ query = query . map { |k , v | [ k . to_s , Array ( v ) . map ( &:to_s ) ] } . to_h
7
+ query_hash = CGI ::parse ( uri . query || '' )
8
+ expect ( query_hash ) . to include ( query )
9
+ end
10
+
11
+ failure_message do |page |
12
+ "expected that #{ page . current_url } would be #{ path } with the query parameters #{ query } "
13
+ end
14
+ end
You can’t perform that action at this time.
0 commit comments