Skip to content

Commit 3d3edb5

Browse files
committed
Change hostnames for test suite
I'm hoping this will help with the selenium based testing
1 parent bbcd01f commit 3d3edb5

8 files changed

Lines changed: 22 additions & 22 deletions

File tree

rails/config/settings.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ development:
6363

6464
test:
6565
url_defaults:
66-
:host: example.com
66+
:host: tiddlyhost-test-example.com
6767
:protocol: http
6868

69-
tiddlyspot_host: tiddlyspot-example.com
69+
tiddlyspot_host: tiddlyspot-test-example.com
7070
thumbs_storage_service: test1
7171
public_thumbs_storage_service: test2
7272

rails/test/controllers/tiddlyspot_controller_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class TiddlyspotControllerTest < ActionDispatch::IntegrationTest
1212
host! "www.#{Settings.tiddlyspot_host}"
1313
get '/'
1414
assert_redirected_to Settings.tiddlyspot_url_defaults
15-
assert_redirected_to 'http://tiddlyspot-example.com/'
15+
assert_redirected_to 'http://tiddlyspot-test-example.com/'
1616
end
1717

1818
def mocked_site(name)
@@ -151,7 +151,7 @@ def with_mocked_site(mock, &)
151151
site.update(redirect_to_site_id: 1)
152152
host! "mysite.#{Settings.tiddlyspot_host}"
153153
get '/'
154-
assert_redirected_to 'http://mysite.example.com'
154+
assert_redirected_to 'http://mysite.tiddlyhost-test-example.com'
155155
end
156156

157157
test 'non-existing site produces 404' do

rails/test/controllers/tiddlywiki_controller_test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def assert_tid_not_found(url)
119119
get '/'
120120
assert_response 401
121121

122-
sign_in_url = 'http://example.com/users/sign_in'
122+
sign_in_url = 'http://tiddlyhost-test-example.com/users/sign_in'
123123
sign_in_url_with_redir = "#{sign_in_url}?s=#{@site.name}"
124124

125125
# The sign in link includes the extra url param
@@ -236,7 +236,7 @@ def assert_tid_not_found(url)
236236
upload_save_site_as_user(user: users(:mary), site: @site, fixture_file: 'index.html',
237237
expected_status: 200, expect_success: false)
238238

239-
assert_equal "If this is your site please log in at\nhttp://example.com and try again.\n",
239+
assert_equal "If this is your site please log in at\nhttp://tiddlyhost-test-example.com and try again.\n",
240240
response.body
241241
end
242242

@@ -289,7 +289,7 @@ def assert_tid_not_found(url)
289289
put_save_site_as_user(user: users(:mary), site: @site, content: new_content,
290290
headers: { 'If-Match' => 'whatever' }, expected_status: 403)
291291
assert_equal(
292-
'If this is your site please log in at http://example.com and try again.', response.body)
292+
'If this is your site please log in at http://tiddlyhost-test-example.com and try again.', response.body)
293293
end
294294

295295
def fetch_site_as_user(user: @user, site: @site, expected_status: 200)

rails/test/integration/claim_sites_test.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,14 @@ def attempt_claim(site_name, password, mocked_site, expected_text)
7979

8080
# Confirm it's visible
8181
visit '/sites'
82-
assert_selector '.sitelink a[href="http://mysite.tiddlyspot-example.com"]', text: 'mysite'
82+
assert_selector '.sitelink a[href="http://mysite.tiddlyspot-test-example.com"]', text: 'mysite'
8383

8484
# Disown it
8585
click_on 'Disown'
8686
assert_current_path '/sites'
8787

8888
# Confirm it's no longer visible and it was really disowned
89-
assert_selector '.sitelink a', text: 'mysite.tiddlyspot-example.com', count: 0
89+
assert_selector '.sitelink a', text: 'mysite.tiddlyspot-test-example.com', count: 0
9090
assert_nil site.reload.user
9191
end
9292

@@ -100,14 +100,14 @@ def attempt_claim(site_name, password, mocked_site, expected_text)
100100

101101
# Confirm it's visible
102102
visit '/sites'
103-
assert_selector '.sitelink a[href="http://mysite.tiddlyspot-example.com"]', text: 'mysite'
103+
assert_selector '.sitelink a[href="http://mysite.tiddlyspot-test-example.com"]', text: 'mysite'
104104

105105
# Delete it
106106
click_on 'Delete'
107107
assert_current_path '/sites'
108108

109109
# Confirm it's no longer visible and it was really deleted
110-
assert_selector '.sitelink a', text: 'mysite.tiddlyspot-example.com', count: 0
110+
assert_selector '.sitelink a', text: 'mysite.tiddlyspot-test-example.com', count: 0
111111
assert site.reload.deleted?
112112
end
113113
end

rails/test/integration/sites_test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class SitesTest < CapybaraIntegrationTest
2323
assert_current_path '/sites'
2424

2525
# The index now includes a link to the new site
26-
expected_url = 'http://bar.example.com'
26+
expected_url = 'http://bar.tiddlyhost-test-example.com'
2727
assert_selector %(td a[href="#{expected_url}"])
2828

2929
# Sanity check the new site
@@ -111,7 +111,7 @@ class SitesTest < CapybaraIntegrationTest
111111
end
112112

113113
test 'non-existent sites' do
114-
non_existent_site = 'http://bbar.example.com/'
114+
non_existent_site = 'http://bbar.tiddlyhost-test-example.com/'
115115

116116
# You get a 404 when visiting a non-existent site
117117
visit non_existent_site
@@ -171,7 +171,7 @@ class SitesTest < CapybaraIntegrationTest
171171

172172
# Back to the sites index after update
173173
assert_current_path '/sites'
174-
assert_selector 'a[href="http://foo.example.com"]', text: 'foo'
174+
assert_selector 'a[href="http://foo.tiddlyhost-test-example.com"]', text: 'foo'
175175
end
176176

177177
test 'uploading a site' do

rails/test/models/site_test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ class SiteTest < ActiveSupport::TestCase
88
end
99

1010
test 'url' do
11-
assert_equal 'mysite.example.com', @site.host
12-
assert_equal 'http://mysite.example.com', @site.url
13-
assert_equal 'http://example.com', Settings.main_site_url
11+
assert_equal 'mysite.tiddlyhost-test-example.com', @site.host
12+
assert_equal 'http://mysite.tiddlyhost-test-example.com', @site.url
13+
assert_equal 'http://tiddlyhost-test-example.com', Settings.main_site_url
1414
end
1515

1616
test 'name validation' do

rails/test/models/tspot_site_test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ class TspotSiteTest < ActiveSupport::TestCase
88
end
99

1010
test 'url' do
11-
assert_equal 'mysite.tiddlyspot-example.com', @site.host
12-
assert_equal 'http://mysite.tiddlyspot-example.com', @site.url
13-
assert_equal 'http://tiddlyspot-example.com', Settings.tiddlyspot_url
11+
assert_equal 'mysite.tiddlyspot-test-example.com', @site.host
12+
assert_equal 'http://mysite.tiddlyspot-test-example.com', @site.url
13+
assert_equal 'http://tiddlyspot-test-example.com', Settings.tiddlyspot_url
1414
end
1515

1616
test 'is_stub' do

rails/test/models/tw_file_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class TwFileTest < ActiveSupport::TestCase
3434
test 'tiddlyhost mods for tw5' do
3535
ThFile.from_empty(:tw5).apply_tiddlyhost_mods('coolsite').tap do |tw|
3636
{
37-
'$:/UploadURL' => 'http://coolsite.example.com',
37+
'$:/UploadURL' => 'http://coolsite.tiddlyhost-test-example.com',
3838
'$:/UploadWithUrlOnly' => 'yes',
3939
'$:/config/AutoSave' => 'no',
4040

@@ -177,7 +177,7 @@ class TwFileTest < ActiveSupport::TestCase
177177
assert_equal "tiddlywikicore-#{tw_version}.js", original_tag['src']
178178

179179
modified_tag = th_file.inject_external_core_url_prefix.external_core_script_tag
180-
assert_equal "http://example.com/tiddlywikicore-#{tw_version}.js", modified_tag['src']
180+
assert_equal "http://tiddlyhost-test-example.com/tiddlywikicore-#{tw_version}.js", modified_tag['src']
181181
end
182182
end
183183

0 commit comments

Comments
 (0)