Sha256: a56b02304f80a637e5784e5773af81100d80d93425b722f8e70994fe00fb655e

Contents?: true

Size: 1 KB

Versions: 22

Compression:

Stored size: 1 KB

Contents

require 'test_helper'

module Shipit
  class PullRequestsControllerTest < ActionController::TestCase
    setup do
      @stack = shipit_stacks(:shipit)
      @pr = shipit_pull_requests(:shipit_pending)
      session[:user_id] = shipit_users(:walrus).id
    end

    test "#index shows pending pull requests" do
      get :index, params: {stack_id: @stack.to_param}
      assert_response :success
      assert_select '.pr-list .pr', @stack.pull_requests.pending.count
    end

    test "#add can enqueue a pull request" do
      assert_difference -> { PullRequest.count }, +1 do
        post :create, params: {stack_id: @stack.to_param, number_or_url: '#5'}
      end
      assert_redirected_to stack_pull_requests_path(@stack)
    end

    test "#destroy can cancel a pending pull request" do
      assert_predicate @pr, :pending?
      delete :destroy, params: {stack_id: @stack.to_param, id: @pr.id}
      assert_redirected_to stack_pull_requests_path(@stack)
      assert_predicate @pr.reload, :canceled?
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
shipit-engine-0.31.0 test/controllers/pull_requests_controller_test.rb
shipit-engine-0.30.0 test/controllers/pull_requests_controller_test.rb
shipit-engine-0.29.0 test/controllers/pull_requests_controller_test.rb
shipit-engine-0.28.1 test/controllers/pull_requests_controller_test.rb
shipit-engine-0.28.0 test/controllers/pull_requests_controller_test.rb
shipit-engine-0.27.1 test/controllers/pull_requests_controller_test.rb
shipit-engine-0.27.0 test/controllers/pull_requests_controller_test.rb
shipit-engine-0.26.0 test/controllers/pull_requests_controller_test.rb
shipit-engine-0.25.1 test/controllers/pull_requests_controller_test.rb
shipit-engine-0.25.0 test/controllers/pull_requests_controller_test.rb
shipit-engine-0.24.0 test/controllers/pull_requests_controller_test.rb
shipit-engine-0.23.1 test/controllers/pull_requests_controller_test.rb
shipit-engine-0.23.0 test/controllers/pull_requests_controller_test.rb
shipit-engine-0.22.0 test/controllers/pull_requests_controller_test.rb
shipit-engine-0.21.0 test/controllers/pull_requests_controller_test.rb
shipit-engine-0.20.1 test/controllers/pull_requests_controller_test.rb
shipit-engine-0.20.0 test/controllers/pull_requests_controller_test.rb
shipit-engine-0.19.0 test/controllers/pull_requests_controller_test.rb
shipit-engine-0.18.1 test/controllers/pull_requests_controller_test.rb
shipit-engine-0.18.0 test/controllers/pull_requests_controller_test.rb