3 class ClientApplicationTest < ActiveSupport::TestCase
4 fixtures :client_applications
7 ok = ["http://example.com/test", "https://example.com/test"]
8 bad = ["", "ftp://example.com/test", "myapp://somewhere"]
11 app = client_applications(:normal_user_app).dup
13 assert app.valid?, "#{url} is invalid, when it should be"
17 app = client_applications(:normal_user_app)
19 assert !app.valid?, "#{url} is valid when it shouldn't be"
23 def test_support_url_valid
24 ok = ["", "http://example.com/test", "https://example.com/test"]
25 bad = ["ftp://example.com/test", "myapp://somewhere", "gibberish"]
28 app = client_applications(:normal_user_app)
30 assert app.valid?, "#{url} is invalid, when it should be"
34 app = client_applications(:normal_user_app)
36 assert !app.valid?, "#{url} is valid when it shouldn't be"
40 def test_callback_url_valid
41 ok = ["", "http://example.com/test", "https://example.com/test", "ftp://example.com/test", "myapp://somewhere"]
45 app = client_applications(:normal_user_app)
46 app.callback_url = url
47 assert app.valid?, "#{url} is invalid, when it should be"
51 app = client_applications(:normal_user_app)
52 app.callback_url = url
53 assert !app.valid?, "#{url} is valid when it shouldn't be"