Skip to content

Commit

Permalink
make team tags use - instead of _ to be url compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
grosser committed Aug 26, 2023
1 parent 4abbcbd commit 60c9a81
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/kennel/models/team.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Models
class Team < Base
settings :mention, :tags, :renotify_interval, :kennel_id
defaults(
tags: -> { ["team:#{kennel_id.sub(/^teams_/, "")}"] },
tags: -> { ["team:#{kennel_id.sub(/^teams_/, "").tr("_", "-")}"] },
renotify_interval: -> { 0 }
)
end
Expand Down
4 changes: 2 additions & 2 deletions test/kennel/models/team_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

describe "#tags" do
it "is a nice searchable name" do
TestTeam.new.tags.must_equal ["team:test_team"]
TestTeam.new.tags.must_equal ["team:test-team"]
end

it "does not prefix teams with folder name if it is teams too" do
Teams::MyTeam.new.tags.must_equal ["team:my_team"]
Teams::MyTeam.new.tags.must_equal ["team:my-team"]
end
end

Expand Down

0 comments on commit 60c9a81

Please sign in to comment.