diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-07-07 13:57:41 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-07-07 13:57:41 +0300 |
commit | f76092c06dd1f3b40a6d32ad3d62ea09bf32d1a0 (patch) | |
tree | 31b0ead46e605f7d3c4ede969f0c1c933b6cc471 /spec/requests | |
parent | 41e6b8d8d8bb183e9313219aa65ea6a786c76133 (diff) | |
parent | 603ceea21a0144ff1900106efa0c17e759eeceef (diff) |
Merge branch 'settings-via-api' into 'master'
API to set application settings for admin
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
See merge request !934
Diffstat (limited to 'spec/requests')
-rw-r--r-- | spec/requests/api/settings_spec.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/requests/api/settings_spec.rb b/spec/requests/api/settings_spec.rb new file mode 100644 index 00000000000..c815a8e1d73 --- /dev/null +++ b/spec/requests/api/settings_spec.rb @@ -0,0 +1,29 @@ +require 'spec_helper' + +describe API::API, 'Settings', api: true do + include ApiHelpers + + let(:user) { create(:user) } + let(:admin) { create(:admin) } + + + describe "GET /application/settings" do + it "should return application settings" do + get api("/application/settings", admin) + expect(response.status).to eq(200) + expect(json_response).to be_an Hash + expect(json_response['default_projects_limit']).to eq(42) + expect(json_response['signin_enabled']).to be_truthy + end + end + + describe "PUT /application/settings" do + it "should update application settings" do + put api("/application/settings", admin), + default_projects_limit: 3, signin_enabled: false + expect(response.status).to eq(200) + expect(json_response['default_projects_limit']).to eq(3) + expect(json_response['signin_enabled']).to be_falsey + end + end +end |