Skip to content

Commit

Permalink
Fix specs
Browse files Browse the repository at this point in the history
  • Loading branch information
JoonasAapro committed Jun 19, 2024
1 parent 438cb56 commit 03fc375
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
uid:,
info: oauth_info
}

allow(organization).to receive(:available_authorizations)
.and_return(["facebook"])
end

context "with successful sign in" do
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 3 additions & 1 deletion spec/presenters/decidim/user_presenter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/types/decidim/comments/comment_type_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 03fc375

Please sign in to comment.