Skip to content

Commit

Permalink
Merge pull request #5 from sk-ys/issue-4
Browse files Browse the repository at this point in the history
Add missing Gemfile
sk-ys authored Aug 7, 2024
2 parents 43560ef + 6bc61b3 commit 8101883
Showing 4 changed files with 28 additions and 1 deletion.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
gem 'ruby-progressbar'
12 changes: 12 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
GEM
specs:
ruby-progressbar (1.13.0)

PLATFORMS
x86_64-linux

DEPENDENCIES
ruby-progressbar

BUNDLED WITH
2.2.33
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ bundle exec rake redmine:plugins:migrate NAME=issue_hierarchy_filter RAILS_ENV=p
### 3. Initialize the `issue_level` table
Run the following command to initialize the `issue_level` table:
```
bundle exec rake issue_hierarchy_filter:update_levels
bundle exec rake issue_hierarchy_filter:update_levels RAILS_ENV=production
```
Note: This will calculate the hierarchy levels for all issues. The processing time may vary depending on the number of registered issues.

14 changes: 14 additions & 0 deletions test/unit/issue_hierarchy_filter_test.rb
Original file line number Diff line number Diff line change
@@ -3,6 +3,10 @@
class IssueHierarchyFilterTest < ActiveSupport::TestCase
fixtures :issues, :projects, :versions, :trackers, :issue_categories

def setup
Rails.application.load_tasks
end

def test_calculate_level
issue1 = Issue.find(1)
assert_equal 0, issue1.calculate_level
@@ -45,4 +49,14 @@ def test_destroy_issue_level
issue_level = IssueLevel.find_by(issue_id: issue.id)
assert_nil issue_level
end

def test_rake_task_update_levels
Rake::Task["issue_hierarchy_filter:update_levels"].reenable

assert_equal 0, IssueLevel.all.count

Rake::Task["issue_hierarchy_filter:update_levels"].invoke

assert_not_equal 0, IssueLevel.all.count
end
end

0 comments on commit 8101883

Please sign in to comment.