]> git.openstreetmap.org Git - rails.git/commitdiff
Merge remote-tracking branch 'openstreetmap/pull/1352'
authorTom Hughes <tom@compton.nu>
Sun, 30 Oct 2016 16:59:20 +0000 (16:59 +0000)
committerTom Hughes <tom@compton.nu>
Sun, 30 Oct 2016 16:59:20 +0000 (16:59 +0000)
1  2 
.rubocop_todo.yml
test/controllers/changeset_controller_test.rb

diff --combined .rubocop_todo.yml
index 83d561ef1f9a16827a9f652b9405b5f612976f3a,b5834b8ce4ad2f968579b137f07bcfe8d23108e0..f1e93f25bfb4cca9988b86bdde67827752574757
@@@ -64,7 -64,7 +64,7 @@@ Metrics/BlockNesting
  # Offense count: 62
  # Configuration parameters: CountComments.
  Metrics/ClassLength:
-   Max: 1658
 -  Max: 1653
++  Max: 1659
  
  # Offense count: 69
  Metrics/CyclomaticComplexity:
index e77083f2d0a169767c50ebc0ca3f675375a8cd74,5744ed9abbd8f24f7f3ccd385d0b9f4e288c9eea..efdf22e54f8b25ad7d2c5613098054dc342fdc26
@@@ -3,6 -3,7 +3,6 @@@ require "changeset_controller
  
  class ChangesetControllerTest < ActionController::TestCase
    api_fixtures
 -  fixtures :changesets_subscribers
  
    ##
    # test all routes which lead to this controller
@@@ -1648,6 -1649,7 +1648,7 @@@ EO
  
      ## Now try with the public user
      changeset = changesets(:public_user_first_change)
+     create(:changeset_tag, :changeset => changeset)
      new_changeset = changeset.to_xml
      new_tag = XML::Node.new "tag"
      new_tag["k"] = "tagtesting"
      end
      assert_response :success
  
 +    changeset = changesets(:normal_user_subscribed_change)
 +    changeset.subscribers.push(users(:normal_user))
 +    changeset.subscribers.push(users(:public_user))
 +    changeset.subscribers.push(users(:suspended_user))
 +    changeset.subscribers.push(users(:deleted_user))
 +
      assert_difference "ChangesetComment.count", 1 do
        assert_difference "ActionMailer::Base.deliveries.size", 1 do
 -        post :comment, :id => changesets(:normal_user_subscribed_change).id, :text => "This is a comment"
 +        post :comment, :id => changeset.id, :text => "This is a comment"
        end
      end
      assert_response :success
  
      assert_difference "ChangesetComment.count", 1 do
        assert_difference "ActionMailer::Base.deliveries.size", 2 do
 -        post :comment, :id => changesets(:normal_user_subscribed_change).id, :text => "This is a comment"
 +        post :comment, :id => changeset.id, :text => "This is a comment"
        end
      end
      assert_response :success
  
      # trying to subscribe when already subscribed
      changeset = changesets(:normal_user_subscribed_change)
 +    changeset.subscribers.push(users(:public_user))
      assert_no_difference "changeset.subscribers.count" do
        post :subscribe, :id => changeset.id
      end
    def test_unsubscribe_success
      basic_authorization(users(:public_user).email, "test")
      changeset = changesets(:normal_user_subscribed_change)
 +    changeset.subscribers.push(users(:public_user))
  
      assert_difference "changeset.subscribers.count", -1 do
        post :unsubscribe, :id => changeset.id