Skip to content

Commit

Permalink
Refactor: Remove Kanban#find, leftover from the refactorings.
Browse files Browse the repository at this point in the history
  • Loading branch information
edavis10 committed Apr 9, 2010
1 parent 243d3a5 commit b4f589d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 15 deletions.
4 changes: 2 additions & 2 deletions app/controllers/kanbans_controller.rb
Expand Up @@ -7,7 +7,7 @@ class KanbansController < ApplicationController

def show
@settings = Setting.plugin_redmine_kanban
@kanban = Kanban.find
@kanban = Kanban.new
end

def update
Expand All @@ -20,7 +20,7 @@ def update

saved = Kanban.update_issue_attributes(params[:issue_id], params[:from], params[:to], User.current, @to_user)

@kanban = Kanban.find
@kanban = Kanban.new
respond_to do |format|

if saved
Expand Down
4 changes: 0 additions & 4 deletions app/models/kanban.rb
Expand Up @@ -41,10 +41,6 @@ def self.staffed_panes
['active','testing','finished','canceled']
end

def self.find
Kanban.new
end

def incoming_issues
@incoming_issues ||= incoming_pane.get_issues
end
Expand Down
18 changes: 9 additions & 9 deletions test/unit/kanban_test.rb
Expand Up @@ -18,7 +18,7 @@ def shared_setup
context "for incoming issues" do
setup {
setup_incoming_issues
@kanban = Kanban.find
@kanban = Kanban.new
}

should "only get incoming issues up to the limit" do
Expand All @@ -35,7 +35,7 @@ def shared_setup
context "for backlog issues" do
setup {
setup_backlog_issues
@kanban = Kanban.find
@kanban = Kanban.new
}

should "only get backlog issues up to the limit" do
Expand Down Expand Up @@ -69,7 +69,7 @@ def shared_setup
context "for quick issues" do
setup {
setup_quick_issues
@kanban = Kanban.find
@kanban = Kanban.new
}

should "only get quick issues up to the limit" do
Expand All @@ -94,7 +94,7 @@ def shared_setup
context "for selected issues" do
setup {
setup_selected_issues
@kanban = Kanban.find
@kanban = Kanban.new
}

should "get all selected issues" do
Expand All @@ -112,7 +112,7 @@ def shared_setup
setup {
setup_active_issues
setup_unknown_user_issues
@kanban = Kanban.find
@kanban = Kanban.new
}

should "only get all active issues" do
Expand All @@ -139,7 +139,7 @@ def shared_setup
setup {
setup_testing_issues
setup_unknown_user_issues
@kanban = Kanban.find
@kanban = Kanban.new
}

should "only get all testing issues" do
Expand All @@ -165,7 +165,7 @@ def shared_setup
context "for finished issues" do
setup {
setup_finished_issues
@kanban = Kanban.find
@kanban = Kanban.new
}

should "only get issues with the configured Finished status" do
Expand Down Expand Up @@ -194,7 +194,7 @@ def shared_setup
context "for canceled issues" do
setup {
setup_canceled_issues
@kanban = Kanban.find
@kanban = Kanban.new
}

should "only get issues with the configured Canceled status" do
Expand All @@ -221,7 +221,7 @@ def shared_setup
end

should "set @users based on the configured role" do
@kanban = Kanban.find
@kanban = Kanban.new
assert_equal 5, @kanban.users.length # +1 Unknown
end
end
Expand Down

0 comments on commit b4f589d

Please sign in to comment.