Skip to content

Commit

Permalink
[#2595] Linked to the Kanban panel.
Browse files Browse the repository at this point in the history
* Added an empty KanbansController
* Added a functional test for KanbansController#index
* Added some routing for cucumber
* Added a cucumber feature for the menu
  • Loading branch information
edavis10 committed Jun 13, 2009
1 parent 3970e44 commit d0b1816
Show file tree
Hide file tree
Showing 10 changed files with 68 additions and 2 deletions.
5 changes: 5 additions & 0 deletions app/controllers/kanbans_controller.rb
@@ -0,0 +1,5 @@
class KanbansController < ApplicationController
unloadable
def index
end
end
2 changes: 2 additions & 0 deletions app/helpers/kanbans_helper.rb
@@ -0,0 +1,2 @@
module KanbansHelper
end
1 change: 1 addition & 0 deletions app/views/kanbans/index.html.erb
@@ -0,0 +1 @@
<h2>Kanbans#index</h2>
11 changes: 11 additions & 0 deletions features/kanban_page.feature
@@ -0,0 +1,11 @@
Feature: Kanban Page
As a user
I want to see issues grouped according to Kanban
So I know what to work on next

Scenario: Kanban top menu item
Given I am logged in
And I am on the Homepage

Then I should see a "top" menu item called "Kanban"

19 changes: 19 additions & 0 deletions features/step_definitions/plugin_steps.rb
@@ -1,7 +1,26 @@
Before do
Sham.reset
end

Given /^there is a user$/ do Given /^there is a user$/ do
@user = User.make @user = User.make
end end


Given /^I am logged in$/ do
@current_user = User.make
User.stubs(:current).returns(@current_user)
end

Given /^I am on the Homepage$/ do
visit url_for(:controller => 'welcome')
end

Then /^I should see a "top" menu item called "(.*)"$/ do |name|
assert_select("div#top-menu") do
assert_select("a", name)
end
end

Then /^there should be a user$/ do Then /^there should be a user$/ do
assert_equal 1, User.count(:conditions => {:login => @user.login}) assert_equal 1, User.count(:conditions => {:login => @user.login})
end end
11 changes: 11 additions & 0 deletions features/support/paths.rb
@@ -0,0 +1,11 @@
def path_to(page_name)
case page_name

when /the homepage/i
url_for(:controller => 'welcome')
# Add more page name => path mappings here

else
raise "Can't find mapping from \"#{page_name}\" to a path."
end
end
5 changes: 5 additions & 0 deletions init.rb
Expand Up @@ -9,4 +9,9 @@
version '0.1.0' version '0.1.0'


requires_redmine :version_or_higher => '0.8.0' requires_redmine :version_or_higher => '0.8.0'

menu(:top_menu,
:kanban,
{:controller => 'kanbans', :action => 'index'},
:caption => :kanban_title)
end end
4 changes: 2 additions & 2 deletions lang/en.yml
@@ -1,2 +1,2 @@
# English strings go here kanban_title: Kanban
my_label: "My label"
1 change: 1 addition & 0 deletions routes.rb
@@ -0,0 +1 @@
resource :kanban
11 changes: 11 additions & 0 deletions test/functional/kanbans_controller_test.rb
@@ -0,0 +1,11 @@
require File.dirname(__FILE__) + '/../test_helper'

class KanbansControllerTest < ActionController::TestCase
context "on GET to :index" do
setup { get :index }

should_respond_with :success
should_render_template :index
should_not_set_the_flash
end
end

0 comments on commit d0b1816

Please sign in to comment.