Commit cca918d2ed8c954f778f359b5894a66aebe565b5
Exists in
master
and in
28 other branches
Merge commit 'refs/merge-requests/142' of git://gitorious.org/noosfero/noosfero …
…into merge-requests/142 Conflicts: test/functional/invite_controller_test.rb (ActionItem2313)
Showing
2 changed files
with
11 additions
and
2 deletions
Show diff stats
test/functional/cms_controller_test.rb
| ... | ... | @@ -583,7 +583,8 @@ class CmsControllerTest < ActionController::TestCase |
| 583 | 583 | should 'be able to add image with alignment' do |
| 584 | 584 | post :new, :type => 'TinyMceArticle', :profile => profile.identifier, :article => { :name => 'image-alignment', :body => "the text of the article with image <img src='#' align='right'/> right align..." } |
| 585 | 585 | saved = TinyMceArticle.find_by_name('image-alignment') |
| 586 | - assert_match /<img src="#" align="right" \/>/, saved.body | |
| 586 | + assert_match /<img.*src="#".*\/>/, saved.body | |
| 587 | + assert_match /<img.*align="right".*\/>/, saved.body | |
| 587 | 588 | end |
| 588 | 589 | |
| 589 | 590 | should 'not be able to add image with alignment when textile' do | ... | ... |
test/functional/invite_controller_test.rb
| ... | ... | @@ -187,9 +187,10 @@ class InviteControllerTest < ActionController::TestCase |
| 187 | 187 | should 'return hash as invitation data if contact list was fetched' do |
| 188 | 188 | contact_list = ContactList.create(:fetched => true) |
| 189 | 189 | get :invitation_data, :profile => profile.identifier, :contact_list => contact_list.id |
| 190 | + hash = {'fetched' => true, 'contact_list' => contact_list.id, 'error' => nil} | |
| 190 | 191 | |
| 191 | 192 | assert_equal 'application/javascript', @response.content_type |
| 192 | - assert_match /\{\"fetched\":\s*true,\s*\"contact_list\":\s*#{contact_list.id},\s*\"error\":\s*null\}/, @response.body | |
| 193 | + assert_equal hash, json_response | |
| 193 | 194 | end |
| 194 | 195 | |
| 195 | 196 | should 'render empty list of contacts' do |
| ... | ... | @@ -232,4 +233,11 @@ class InviteControllerTest < ActionController::TestCase |
| 232 | 233 | assert_equal 'pt', Delayed::Job.first.payload_object.locale |
| 233 | 234 | end |
| 234 | 235 | |
| 236 | + private | |
| 237 | + | |
| 238 | + def json_response | |
| 239 | + ActiveSupport::JSON.decode @response.body | |
| 240 | + end | |
| 241 | + | |
| 242 | + | |
| 235 | 243 | end | ... | ... |