-
-
Notifications
You must be signed in to change notification settings - Fork 392
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* fix displaying block users * able to render ressource * fix gemfile test * fix gemfile test * fix gemfile test * refactor change * refactor change * linter * add unit test * linter * add trait Co-authored-by: eliegaboriau <93646702+eliegaboriau@users.noreply.github.com>
- Loading branch information
1 parent
d507169
commit 7583904
Showing
4 changed files
with
64 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# frozen_string_literal: true | ||
|
||
require "spec_helper" | ||
|
||
module Decidim | ||
describe UserBaseEntity do | ||
subject { user } | ||
|
||
let(:organization) { create(:organization) } | ||
let(:user) { build(:user, organization: organization) } | ||
|
||
let(:user_followed) { create(:user, organization: user.organization) } | ||
let(:public_resource) { create(:dummy_resource, :published) } | ||
let(:user_blocked) { create(:user, organization: user.organization, blocked: true) } | ||
|
||
before do | ||
create(:follow, user: user, followable: user_followed) | ||
create(:follow, user: user, followable: public_resource) | ||
create(:follow, user: user, followable: user_blocked) | ||
end | ||
|
||
describe "public followings" do | ||
it "return all the things followed unless the blocked users" do | ||
expect(subject.public_followings).to eq([public_resource, user_followed]) | ||
end | ||
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