forked from mastodon/mastodon
-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add coverage for
StatusTrend
and PreviewCardTrend
models, add `lo…
…cales` class method to `RankedTrend` (mastodon#32688)
- Loading branch information
1 parent
df3b954
commit babee06
Showing
9 changed files
with
64 additions
and
4 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
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
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
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
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
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,5 @@ | ||
# frozen_string_literal: true | ||
|
||
Fabricator(:preview_card_trend) do | ||
preview_card | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# frozen_string_literal: true | ||
|
||
Fabricator(:status_trend) do | ||
status | ||
account | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
|
||
RSpec.describe PreviewCardTrend do | ||
describe 'Associations' do | ||
it { is_expected.to belong_to(:preview_card).required } | ||
end | ||
|
||
describe '.locales' do | ||
before do | ||
Fabricate :preview_card_trend, language: 'en' | ||
Fabricate :preview_card_trend, language: 'en' | ||
Fabricate :preview_card_trend, language: 'es' | ||
end | ||
|
||
it 'returns unique set of languages' do | ||
expect(described_class.locales) | ||
.to eq(['en', 'es']) | ||
end | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
|
||
RSpec.describe StatusTrend do | ||
describe 'Associations' do | ||
it { is_expected.to belong_to(:account).required } | ||
it { is_expected.to belong_to(:status).required } | ||
end | ||
|
||
describe '.locales' do | ||
before do | ||
Fabricate :status_trend, language: 'en' | ||
Fabricate :status_trend, language: 'en' | ||
Fabricate :status_trend, language: 'es' | ||
end | ||
|
||
it 'returns unique set of languages' do | ||
expect(described_class.locales) | ||
.to eq(['en', 'es']) | ||
end | ||
end | ||
end |