summaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
authorjessib <jessib@riseup.net>2013-12-30 13:32:43 -0800
committerjessib <jessib@riseup.net>2013-12-30 13:32:43 -0800
commitc3fadeb8da6eb4400a3ceb2fecee83173eceeaf2 (patch)
tree88b550fbda71286266831910913e6789b89ef2ea /test/functional
parent7d1a25c2477b9607475f6b4c56f94d392c46950a (diff)
parent62f31ab0358bc165c9a83806db1828365cb96572 (diff)
Merge branch 'develop' into feature/messages_cron
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/static_config_controller_test.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/functional/static_config_controller_test.rb b/test/functional/static_config_controller_test.rb
new file mode 100644
index 0000000..9c2cfef
--- /dev/null
+++ b/test/functional/static_config_controller_test.rb
@@ -0,0 +1,27 @@
+require 'test_helper'
+
+# use minitest for stubbing, rather than bloated mocha
+require 'minitest/stub_const'
+
+class StaticConfigControllerTest < ActionController::TestCase
+
+ def setup
+ end
+
+ def test_provider_success
+ StaticConfigController.stub_const(:PROVIDER_JSON, file_path('provider.json')) do
+ get :provider, format: :json
+ assert_equal 'application/json', @response.content_type
+ assert_response :success
+ end
+ end
+
+ def test_provider_not_modified
+ StaticConfigController.stub_const(:PROVIDER_JSON, file_path('provider.json')) do
+ request.env["HTTP_IF_MODIFIED_SINCE"] = File.mtime(file_path('provider.json')).rfc2822()
+ get :provider, format: :json
+ assert_response 304
+ end
+ end
+
+end