Adjust test code.
[ecs.git] / test / controllers / memberships_controller_test.rb
blobce2402033d0580291cf0026eb6cb6565eba90db9
1 # Copyright (C) 2007, 2008, 2009, 2010 Heiko Bernloehr (FreeIT.de).
2
3 # This file is part of ECS.
4
5 # ECS is free software: you can redistribute it and/or modify it
6 # under the terms of the GNU Affero General Public License as
7 # published by the Free Software Foundation, either version 3 of
8 # the License, or (at your option) any later version.
9
10 # ECS is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 # Affero General Public License for more details.
14
15 # You should have received a copy of the GNU Affero General Public
16 # License along with ECS. If not, see <http://www.gnu.org/licenses/>.
19 require 'test_helper'
21 class MembershipsControllerTest < ActionController::TestCase
23   test "prettyfied memberships" do
24     request.headers["X-EcsAuthId"] = identities(:ulm_id1).name
25     request.headers["Accept"] = "application/json"
26     get  :index
27     assert_response 200
28     f = StringIO.open @response.body
29     b = f.readlines
30     f.close
31     assert b.length > 1, "/memberships representation is not prettyfied json.\nMaybe json-pretty doesn't work.\nMaybe old gems ? Especially the json gem."
32   end
34 end