Commit 7750bb37d186eba4f307675096600cf23ee214aa
1 parent
debcfb2a
Exists in
master
and in
21 other branches
fix comment_classification plugin
Showing
4 changed files
with
13 additions
and
10 deletions
Show diff stats
lib/tasks/plugins_tests.rake
| @@ -108,7 +108,7 @@ def run_test(name, files) | @@ -108,7 +108,7 @@ def run_test(name, files) | ||
| 108 | files = Array(files) | 108 | files = Array(files) |
| 109 | plugin = filename2plugin(files.first) | 109 | plugin = filename2plugin(files.first) |
| 110 | if name == :cucumber || name == :selenium | 110 | if name == :cucumber || name == :selenium |
| 111 | - run_cucumber task2_profile(name, plugin), files | 111 | + run_cucumber task2profile(name, plugin), files |
| 112 | else | 112 | else |
| 113 | run_testrb files | 113 | run_testrb files |
| 114 | end | 114 | end |
| @@ -136,7 +136,11 @@ end | @@ -136,7 +136,11 @@ end | ||
| 136 | 136 | ||
| 137 | def run_tests(name, plugins, run=:all) | 137 | def run_tests(name, plugins, run=:all) |
| 138 | plugins = Array(plugins) | 138 | plugins = Array(plugins) |
| 139 | + if name == :cucumber || name == :selenium | ||
| 140 | + glob = "plugins/{#{plugins.join(',')}}/#{task2folder(name)}/**/*.#{task2ext(name)}" | ||
| 141 | + else | ||
| 139 | glob = "plugins/{#{plugins.join(',')}}/test/#{task2folder(name)}/**/*.#{task2ext(name)}" | 142 | glob = "plugins/{#{plugins.join(',')}}/test/#{task2folder(name)}/**/*.#{task2ext(name)}" |
| 143 | + end | ||
| 140 | files = Dir.glob(glob) | 144 | files = Dir.glob(glob) |
| 141 | if files.empty? | 145 | if files.empty? |
| 142 | puts "I: no tests to run #{name}" | 146 | puts "I: no tests to run #{name}" |
plugins/comment_classification/features/step_definitions/plugin_steps.rb
| 1 | Given /^CommentClassificationPlugin is enabled$/ do | 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 | Environment.default.enabled_plugins.should include("CommentClassificationPlugin") | 10 | Environment.default.enabled_plugins.should include("CommentClassificationPlugin") |
| 8 | end | 11 | end |
| 9 | 12 |
plugins/comment_classification/lib/comment_classification_plugin.rb