-
-
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.
- Loading branch information
1 parent
f56c8f9
commit 4deedce
Showing
4 changed files
with
100 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,7 +78,7 @@ | |
} | ||
|
||
#proposals { | ||
.view-layout__links{ | ||
.view-layout__links { | ||
svg { | ||
@apply inline-block w-5 h-5; | ||
|
||
|
46 changes: 46 additions & 0 deletions
46
decidim-proposals/spec/cells/decidim/proposals/proposal_g_cell_spec.rb
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,46 @@ | ||
# frozen_string_literal: true | ||
|
||
require "spec_helper" | ||
|
||
module Decidim::Proposals | ||
describe ProposalGCell, type: :cell do | ||
controller Decidim::Proposals::ProposalsController | ||
|
||
subject(:cell_html) { my_cell.call } | ||
|
||
let(:my_cell) { cell("decidim/proposals/proposal_g", proposal, card_size: :g) } | ||
let(:component) { create(:proposal_component, :with_attachments_allowed) } | ||
let!(:proposal) { create(:proposal, :evaluating, component:) } | ||
let(:user) { create(:user, organization: proposal.participatory_space.organization) } | ||
|
||
before do | ||
allow(controller).to receive(:current_user).and_return(user) | ||
end | ||
|
||
describe "show" do | ||
it "renders the proposal state item with appropriate class" do | ||
expect(subject).to have_css("span.warning", text: "Evaluating") | ||
end | ||
|
||
it "renders the proposal title" do | ||
expect(subject).to have_content(translated_attribute(proposal.title)) | ||
end | ||
|
||
context "when the proposal has an image" do | ||
let!(:attachment) { create(:attachment, attached_to: proposal) } | ||
|
||
it "renders the proposal with an image" do | ||
expect(subject).to have_css("img[src*='city']") | ||
end | ||
end | ||
|
||
context "when the proposal has no image" do | ||
before { allow(proposal).to receive(:attachments).and_return([]) } | ||
|
||
it "renders a placeholder image" do | ||
expect(subject).to have_css("img[src*='proposal_image_placeholder']") | ||
end | ||
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