-
-
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.
Fix user profile timeline activity cards texts showing "New resource"…
… on updates (#7558)
- Loading branch information
Showing
11 changed files
with
198 additions
and
18 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
59 changes: 59 additions & 0 deletions
59
decidim-debates/spec/cells/decidim/debates/debate_activity_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,59 @@ | ||
# frozen_string_literal: true | ||
|
||
require "spec_helper" | ||
|
||
module Decidim | ||
module Debates | ||
describe DebateActivityCell, type: :cell do | ||
controller Decidim::LastActivitiesController | ||
|
||
let!(:debate) { create(:debate) } | ||
let(:action) { :publish } | ||
let(:action_log) do | ||
create( | ||
:action_log, | ||
action: action, | ||
resource: debate, | ||
organization: debate.organization, | ||
component: debate.component, | ||
participatory_space: debate.participatory_space | ||
) | ||
end | ||
|
||
context "when rendering" do | ||
it "renders the card" do | ||
html = cell("decidim/debates/debate_activity", action_log).call | ||
expect(html).to have_css("#action-#{action_log.id} .card__content") | ||
end | ||
|
||
context "when action is update" do | ||
let(:action) { :update } | ||
|
||
it "renders the correct title" do | ||
html = cell("decidim/debates/debate_activity", action_log).call | ||
expect(html).to have_css("#action-#{action_log.id} .card__content") | ||
expect(html).to have_content("Debate updated") | ||
end | ||
end | ||
|
||
context "when action is create" do | ||
let(:action) { :create } | ||
|
||
it "renders the correct title" do | ||
html = cell("decidim/debates/debate_activity", action_log).call | ||
expect(html).to have_css("#action-#{action_log.id} .card__content") | ||
expect(html).to have_content("New debate") | ||
end | ||
end | ||
|
||
context "when action is publish" do | ||
it "renders the correct title" do | ||
html = cell("decidim/debates/debate_activity", action_log).call | ||
expect(html).to have_css("#action-#{action_log.id} .card__content") | ||
expect(html).to have_content("New debate") | ||
end | ||
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
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
59 changes: 59 additions & 0 deletions
59
decidim-meetings/spec/cells/decidim/meetings/meeting_activity_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,59 @@ | ||
# frozen_string_literal: true | ||
|
||
require "spec_helper" | ||
|
||
module Decidim | ||
module Meetings | ||
describe MeetingActivityCell, type: :cell do | ||
controller Decidim::LastActivitiesController | ||
|
||
let!(:meeting) { create(:meeting) } | ||
let(:action) { :publish } | ||
let(:action_log) do | ||
create( | ||
:action_log, | ||
action: action, | ||
resource: meeting, | ||
organization: meeting.organization, | ||
component: meeting.component, | ||
participatory_space: meeting.participatory_space | ||
) | ||
end | ||
|
||
context "when rendering" do | ||
it "renders the card" do | ||
html = cell("decidim/meetings/meeting_activity", action_log).call | ||
expect(html).to have_css("#action-#{action_log.id} .card__content") | ||
end | ||
|
||
context "when action is update" do | ||
let(:action) { :update } | ||
|
||
it "renders the correct title" do | ||
html = cell("decidim/meetings/meeting_activity", action_log).call | ||
expect(html).to have_css("#action-#{action_log.id} .card__content") | ||
expect(html).to have_content("Meeting updated") | ||
end | ||
end | ||
|
||
context "when action is create" do | ||
let(:action) { :create } | ||
|
||
it "renders the correct title" do | ||
html = cell("decidim/meetings/meeting_activity", action_log).call | ||
expect(html).to have_css("#action-#{action_log.id} .card__content") | ||
expect(html).to have_content("New meeting") | ||
end | ||
end | ||
|
||
context "when action is publish" do | ||
it "renders the correct title" do | ||
html = cell("decidim/meetings/meeting_activity", action_log).call | ||
expect(html).to have_css("#action-#{action_log.id} .card__content") | ||
expect(html).to have_content("New meeting") | ||
end | ||
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
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