Commit 9a7bbdf2b04e1240426605fbdbc3ce40ba008330
1 parent
71d849ce
Exists in
master
and in
29 other branches
[plugins-tests] Fixing display_content tests
Showing
2 changed files
with
16 additions
and
16 deletions
Show diff stats
plugins/display_content/test/functional/display_content_plugin_admin_controller_test.rb
... | ... | @@ -41,7 +41,7 @@ class DisplayContentPluginAdminControllerTest < ActionController::TestCase |
41 | 41 | Article.delete_all |
42 | 42 | get :index, :block_id => block.id |
43 | 43 | json_response = ActiveSupport::JSON.decode(@response.body) |
44 | - assert_equal [], json_response | |
44 | + assert_equivalent [], json_response | |
45 | 45 | end |
46 | 46 | |
47 | 47 | should 'index action returns an json with node content' do |
... | ... | @@ -53,7 +53,7 @@ class DisplayContentPluginAdminControllerTest < ActionController::TestCase |
53 | 53 | expected_json = {'data' => article.title} |
54 | 54 | expected_json['attr'] = { 'node_id' => article.id, 'parent_id' => article.parent_id} |
55 | 55 | |
56 | - assert_equal [expected_json], json_response | |
56 | + assert_equivalent [expected_json], json_response | |
57 | 57 | end |
58 | 58 | |
59 | 59 | should 'index action returns an json with node checked if the node is in the nodes list' do |
... | ... | @@ -68,7 +68,7 @@ class DisplayContentPluginAdminControllerTest < ActionController::TestCase |
68 | 68 | expected_json['attr'] = { 'node_id' => article.id, 'parent_id' => article.parent_id} |
69 | 69 | expected_json['attr'].merge!({'class' => 'jstree-checked'}) |
70 | 70 | |
71 | - assert_equal [expected_json], json_response | |
71 | + assert_equivalent [expected_json], json_response | |
72 | 72 | end |
73 | 73 | |
74 | 74 | should 'index action returns an json with node undetermined if the node is in the parent nodes list' do |
... | ... | @@ -84,7 +84,7 @@ class DisplayContentPluginAdminControllerTest < ActionController::TestCase |
84 | 84 | expected_json['attr'].merge!({'class' => 'jstree-undetermined'}) |
85 | 85 | expected_json['children'] = [] |
86 | 86 | |
87 | - assert_equal [expected_json], json_response | |
87 | + assert_equivalent [expected_json], json_response | |
88 | 88 | end |
89 | 89 | |
90 | 90 | should 'index action returns an json with node closed if the node has article with children' do |
... | ... | @@ -98,7 +98,7 @@ class DisplayContentPluginAdminControllerTest < ActionController::TestCase |
98 | 98 | expected_json['attr'] = { 'node_id' => f.id, 'parent_id' => f.parent_id} |
99 | 99 | expected_json['state'] = 'closed' |
100 | 100 | |
101 | - assert_equal [expected_json], json_response | |
101 | + assert_equivalent [expected_json], json_response | |
102 | 102 | end |
103 | 103 | |
104 | 104 | should 'index action returns an json with all the children nodes if some parent is in the parents list' do |
... | ... | @@ -121,7 +121,7 @@ class DisplayContentPluginAdminControllerTest < ActionController::TestCase |
121 | 121 | expected_json['children'] = children |
122 | 122 | expected_json['state'] = 'closed' |
123 | 123 | |
124 | - assert_equal [expected_json], json_response | |
124 | + assert_equivalent [expected_json], json_response | |
125 | 125 | end |
126 | 126 | |
127 | 127 | should 'index action returns an json with all the children nodes and root nodes if some parent is in the parents list and there is others root articles' do |
... | ... | @@ -151,7 +151,7 @@ class DisplayContentPluginAdminControllerTest < ActionController::TestCase |
151 | 151 | value['attr'] = { 'node_id' => a3.id, 'parent_id' => a3.parent_id} |
152 | 152 | expected_json.push(value) |
153 | 153 | |
154 | - assert_equal expected_json, json_response | |
154 | + assert_equivalent expected_json, json_response | |
155 | 155 | end |
156 | 156 | |
157 | 157 | should 'index action returns an json without children nodes if the parent is not in the parents list' do |
... | ... | @@ -173,7 +173,7 @@ class DisplayContentPluginAdminControllerTest < ActionController::TestCase |
173 | 173 | value['attr'] = { 'node_id' => a3.id, 'parent_id' => a3.parent_id} |
174 | 174 | expected_json.push(value) |
175 | 175 | |
176 | - assert_equal expected_json, json_response | |
176 | + assert_equivalent expected_json, json_response | |
177 | 177 | end |
178 | 178 | |
179 | 179 | end | ... | ... |
plugins/display_content/test/functional/display_content_plugin_myprofile_controller_test.rb
... | ... | @@ -41,7 +41,7 @@ class DisplayContentPluginMyprofileControllerTest < ActionController::TestCase |
41 | 41 | Article.delete_all |
42 | 42 | get :index, :block_id => block.id, :profile => profile.identifier |
43 | 43 | json_response = ActiveSupport::JSON.decode(@response.body) |
44 | - assert_equal [], json_response | |
44 | + assert_equivalent [], json_response | |
45 | 45 | end |
46 | 46 | |
47 | 47 | should 'index action returns an json with node content' do |
... | ... | @@ -53,7 +53,7 @@ class DisplayContentPluginMyprofileControllerTest < ActionController::TestCase |
53 | 53 | expected_json = {'data' => article.title} |
54 | 54 | expected_json['attr'] = { 'node_id' => article.id, 'parent_id' => article.parent_id} |
55 | 55 | |
56 | - assert_equal [expected_json], json_response | |
56 | + assert_equivalent [expected_json], json_response | |
57 | 57 | end |
58 | 58 | |
59 | 59 | should 'index action returns an json with node checked if the node is in the nodes list' do |
... | ... | @@ -68,7 +68,7 @@ class DisplayContentPluginMyprofileControllerTest < ActionController::TestCase |
68 | 68 | expected_json['attr'] = { 'node_id' => article.id, 'parent_id' => article.parent_id} |
69 | 69 | expected_json['attr'].merge!({'class' => 'jstree-checked'}) |
70 | 70 | |
71 | - assert_equal [expected_json], json_response | |
71 | + assert_equivalent [expected_json], json_response | |
72 | 72 | end |
73 | 73 | |
74 | 74 | should 'index action returns an json with node undetermined if the node is in the parent nodes list' do |
... | ... | @@ -84,7 +84,7 @@ class DisplayContentPluginMyprofileControllerTest < ActionController::TestCase |
84 | 84 | expected_json['attr'].merge!({'class' => 'jstree-undetermined'}) |
85 | 85 | expected_json['children'] = [] |
86 | 86 | |
87 | - assert_equal [expected_json], json_response | |
87 | + assert_equivalent [expected_json], json_response | |
88 | 88 | end |
89 | 89 | |
90 | 90 | should 'index action returns an json with node closed if the node has article with children' do |
... | ... | @@ -99,7 +99,7 @@ class DisplayContentPluginMyprofileControllerTest < ActionController::TestCase |
99 | 99 | expected_json['attr'] = { 'node_id' => f.id, 'parent_id' => f.parent_id} |
100 | 100 | expected_json['state'] = 'closed' |
101 | 101 | |
102 | - assert_equal [expected_json], json_response | |
102 | + assert_equivalent [expected_json], json_response | |
103 | 103 | end |
104 | 104 | |
105 | 105 | should 'index action returns an json with all the children nodes if some parent is in the parents list' do |
... | ... | @@ -122,7 +122,7 @@ class DisplayContentPluginMyprofileControllerTest < ActionController::TestCase |
122 | 122 | expected_json['children'] = children |
123 | 123 | expected_json['state'] = 'closed' |
124 | 124 | |
125 | - assert_equal [expected_json], json_response | |
125 | + assert_equivalent [expected_json], json_response | |
126 | 126 | end |
127 | 127 | |
128 | 128 | should 'index action returns an json with all the children nodes and root nodes if some parent is in the parents list and there is others root articles' do |
... | ... | @@ -152,7 +152,7 @@ class DisplayContentPluginMyprofileControllerTest < ActionController::TestCase |
152 | 152 | value['attr'] = { 'node_id' => a3.id, 'parent_id' => a3.parent_id} |
153 | 153 | expected_json.push(value) |
154 | 154 | |
155 | - assert_equal expected_json, json_response | |
155 | + assert_equivalent expected_json, json_response | |
156 | 156 | end |
157 | 157 | |
158 | 158 | should 'index action returns an json without children nodes if the parent is not in the parents list' do |
... | ... | @@ -174,7 +174,7 @@ class DisplayContentPluginMyprofileControllerTest < ActionController::TestCase |
174 | 174 | value['attr'] = { 'node_id' => a3.id, 'parent_id' => a3.parent_id} |
175 | 175 | expected_json.push(value) |
176 | 176 | |
177 | - assert_equal expected_json, json_response | |
177 | + assert_equivalent expected_json, json_response | |
178 | 178 | end |
179 | 179 | |
180 | 180 | end | ... | ... |