diff --git a/app/presenters/concerns/decidim/privacy/user_presenter_extensions.rb b/app/presenters/concerns/decidim/privacy/user_presenter_extensions.rb index 7b92943..3925a9a 100644 --- a/app/presenters/concerns/decidim/privacy/user_presenter_extensions.rb +++ b/app/presenters/concerns/decidim/privacy/user_presenter_extensions.rb @@ -23,6 +23,7 @@ def profile_url def avatar_url(variant = nil) return Decidim::AvatarUploader.new(Decidim::User.new, :avatar).default_url if __getobj__.nil? + return default_avatar_url unless __getobj__.public? return default_avatar_url if __getobj__.blocked? return default_avatar_url unless avatar.attached? diff --git a/spec/controllers/decidim/devise/omniauth_registrations_controller_spec.rb b/spec/controllers/decidim/devise/omniauth_registrations_controller_spec.rb index d69f6d8..ac52f98 100644 --- a/spec/controllers/decidim/devise/omniauth_registrations_controller_spec.rb +++ b/spec/controllers/decidim/devise/omniauth_registrations_controller_spec.rb @@ -24,6 +24,9 @@ uid:, info: oauth_info } + + allow(organization).to receive(:available_authorizations) + .and_return(["facebook"]) end context "with successful sign in" do @@ -64,7 +67,7 @@ end it "redirects to the authorizations path" do - expect(subject).to redirect_to("/authorizations") + expect(subject).to redirect_to("/authorizations/first_login") end it "creates a new user" do @@ -90,7 +93,7 @@ end it "redirects to the authorizations path" do - expect(subject).to redirect_to("/authorizations") + expect(subject).to redirect_to("/authorizations/first_login") end it "creates a new user" do diff --git a/spec/presenters/decidim/user_presenter_spec.rb b/spec/presenters/decidim/user_presenter_spec.rb index 860766d..c21c23e 100644 --- a/spec/presenters/decidim/user_presenter_spec.rb +++ b/spec/presenters/decidim/user_presenter_spec.rb @@ -66,7 +66,9 @@ user.avatar.attach(avatar_image) end - it { is_expected.to eq(described_class.new(user).default_avatar_url) } + it "is a test" do + expect(subject).to eq(described_class.new(user).default_avatar_url) + end context "when public" do before do diff --git a/spec/types/decidim/comments/comment_type_spec.rb b/spec/types/decidim/comments/comment_type_spec.rb index 8757e3e..bbb8077 100644 --- a/spec/types/decidim/comments/comment_type_spec.rb +++ b/spec/types/decidim/comments/comment_type_spec.rb @@ -15,7 +15,7 @@ let(:query) { "{ author { id name nickname avatarUrl profilePath badge organizationName } }" } context "when the author is public" do - let(:avatar_url) { author.attached_uploader(:avatar).url(variant: :thumb) } + let(:avatar_url) { author.attached_uploader(:avatar).path(variant: :thumb) } it "returns the user's name" do expect(response["author"]).to include("name" => author.name)