Commit 7750bb37d186eba4f307675096600cf23ee214aa

Authored by Junior Silva
1 parent debcfb2a

fix comment_classification plugin

lib/tasks/plugins_tests.rake
... ... @@ -108,7 +108,7 @@ def run_test(name, files)
108 108 files = Array(files)
109 109 plugin = filename2plugin(files.first)
110 110 if name == :cucumber || name == :selenium
111   - run_cucumber task2_profile(name, plugin), files
  111 + run_cucumber task2profile(name, plugin), files
112 112 else
113 113 run_testrb files
114 114 end
... ... @@ -136,7 +136,11 @@ end
136 136  
137 137 def run_tests(name, plugins, run=:all)
138 138 plugins = Array(plugins)
  139 + if name == :cucumber || name == :selenium
  140 + glob = "plugins/{#{plugins.join(',')}}/#{task2folder(name)}/**/*.#{task2ext(name)}"
  141 + else
139 142 glob = "plugins/{#{plugins.join(',')}}/test/#{task2folder(name)}/**/*.#{task2ext(name)}"
  143 + end
140 144 files = Dir.glob(glob)
141 145 if files.empty?
142 146 puts "I: no tests to run #{name}"
... ...
plugins/comment_classification/features/step_definitions/plugin_steps.rb
1 1 Given /^CommentClassificationPlugin is enabled$/ do
2   - step %{I am logged in as admin}
3   - step %{I am on the environment control panel}
4   - step %{I follow "Plugins"}
5   - step %{I check "Comment Classification"}
6   - step %{I press "Save changes"}
  2 + steps %Q{
  3 + Given I am logged in as admin
  4 + Given I am on the environment control panel
  5 + Given I follow "Plugins"
  6 + Given I check "Comment Classification"
  7 + Given I press "Save changes"
  8 + }
  9 +
7 10 Environment.default.enabled_plugins.should include("CommentClassificationPlugin")
8 11 end
9 12  
... ...
plugins/comment_classification/lib/comment_classification_plugin.rb
1   -require 'ext/environment'
2   -require 'ext/comment'
3 1  
4 2 class CommentClassificationPlugin < Noosfero::Plugin
5 3  
... ...
plugins/comment_classification/lib/ext/comment.rb
1 1 require_dependency 'comment'
2   -require 'comment_classification_plugin.rb'
3   -require 'comment_classification_plugin/label.rb'
4 2  
5 3 class Comment
6 4  
... ...