Permalink
Browse files

Merge pull request #36 from Undev/master

Fixed calendar/show bug, fixed test_helper (issue status can't be blank)
  • Loading branch information...
2 parents a91fcf9 + fa054d3 commit 80a2192d8f886a08145b2ad5d9e0fbeaa3a008b1 friflaj committed Jan 4, 2013
View
4 lib/tagging_plugin/tagging_patches.rb
@@ -160,9 +160,7 @@ def update_with_tags
WikiPage.send(:include, TaggingPlugin::WikiPagePatch) unless WikiPage.included_modules.include? TaggingPlugin::WikiPagePatch
-[IssuesController, ReportsController, WikiController, ProjectsController].each do |controller|
- controller.send(:include, TaggingPlugin::TaggingHelperPatch) unless controller.include? TaggingPlugin::TaggingHelperPatch
-end
+ApplicationController.send(:include, TaggingPlugin::TaggingHelperPatch) unless ApplicationController.include? TaggingPlugin::TaggingHelperPatch
WikiController.send(:include, TaggingPlugin::WikiControllerPatch) unless WikiController.included_modules.include? TaggingPlugin::WikiControllerPatch
View
20 test/functional/calendars_controller_test.rb
@@ -0,0 +1,20 @@
+require File.dirname(__FILE__) + '/../test_helper'
+
+class CalendarsControllerTest < ActionController::TestCase
+ fixtures :projects, :issues, :users, :trackers
+
+ def setup
+ @request.session[:user_id] = 2
+ User.stubs(:current).returns(User.find_by_id(2))
+ User.any_instance.stubs(:allowed_to?).returns(true)
+ Mailer.stubs(:deliver_mail).returns(true)
+ @some_tags = "#1, #2, #3,#4,#5"
+ @issue_with_tags = setup_issue_with_tags(@some_tags)
+ @project_with_tags = @issue_with_tags.project
+ end
+
+ def test_can_show_calendar
+ get :show, :project_id => @project_with_tags.id
+ assert_response :success
+ end
+end
View
20 test/functional/gantts_controller_test.rb
@@ -0,0 +1,20 @@
+require File.dirname(__FILE__) + '/../test_helper'
+
+class GanttsControllerTest < ActionController::TestCase
+ fixtures :projects, :issues, :users, :trackers
+
+ def setup
+ @request.session[:user_id] = 2
+ User.stubs(:current).returns(User.find_by_id(2))
+ User.any_instance.stubs(:allowed_to?).returns(true)
+ Mailer.stubs(:deliver_mail).returns(true)
+ @some_tags = "#1, #2, #3,#4,#5"
+ @issue_with_tags = setup_issue_with_tags(@some_tags)
+ @project_with_tags = @issue_with_tags.project
+ end
+
+ def test_can_show_gantt
+ get :show, :project_id => @project_with_tags.id
+ assert_response :success
+ end
+end
View
9 test/test_helper.rb
@@ -16,7 +16,14 @@ def setup_issue_with_tags(test_tags)
priority.save!
public_project.trackers << tracker
- issue = Issue.generate!(:project_id => public_project.id, :tracker => tracker, :priority => priority)
+ status = IssueStatus.create!(:name => "test_status#{public_project.id}")
+
+ issue = Issue.generate!({
+ :project_id => public_project.id,
+ :tracker => tracker,
+ :priority => priority,
+ :status => status
+ })
issue.tags_to_update = test_tags
issue.save!

0 comments on commit 80a2192

Please sign in to comment.