-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move tests from TagTest to ProjectMedia8Test
What we are testing is that tags are being created when we create a project media. The method we use to do that is a method called by project_media, so I thought it made more sense to move the tests.
- Loading branch information
1 parent
23315b0
commit 158e8f6
Showing
2 changed files
with
29 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
require_relative '../test_helper' | ||
|
||
class ProjectMedia8Test < ActiveSupport::TestCase | ||
def setup | ||
super | ||
require 'sidekiq/testing' | ||
end | ||
|
||
test "when creating an item with tag/tags, tags should be created in the background" do | ||
Sidekiq::Testing.inline! | ||
|
||
t = create_team | ||
p = create_project team: t | ||
assert_nothing_raised do | ||
create_project_media project: p, tags: ['one'] | ||
end | ||
end | ||
|
||
test "when creating an item with multiple tags, only one job should be scheduled" do | ||
Sidekiq::Testing.fake! | ||
|
||
t = create_team | ||
p = create_project team: t | ||
assert_nothing_raised do | ||
create_project_media project: p, tags: ['one', 'two', 'three'] | ||
end | ||
assert_equal 1, GenericWorker.jobs.size | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters