Skip to content

Commit c9f8ff7

Browse files
committed
Test that the URL is updated for the shared gist
1 parent 103fb94 commit c9f8ff7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/spec/features/sharing_with_others_spec.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
require 'spec_helper'
22
require 'support/editor'
3+
require 'support/matchers/be_at_url'
34
require 'support/playground_actions'
45

56
RSpec.feature "Sharing the code with others", type: :feature, js: true do
@@ -23,6 +24,10 @@
2324
direct_link = find_link("Direct link to the gist")[:href]
2425
urlo_link = find_link("Open a new thread in the Rust user forum")[:href]
2526

27+
# Have we automatically added the gist to our URL?
28+
gist_id = Addressable::URI.parse(perma_link).query_values['gist']
29+
expect(page).to be_at_url('/', gist: gist_id)
30+
2631
# Navigate away so we can tell that we go back to the same page
2732
visit 'about:blank'
2833

0 commit comments

Comments
 (0)