Skip to content

Commit

Permalink
Time Zone indication in Conference program (#138)
Browse files Browse the repository at this point in the history
* add time zone to conference_program, add tests

* remove extra code

* fix chromedriver in test.yml
  • Loading branch information
antopalidi authored Jan 9, 2024
1 parent b3aa7d2 commit 1ddf197
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ jobs:
with:
fetch-depth: 1

- uses: nanasess/setup-chromedriver@v2
with:
chromedriver-version: 119.0.6045.105

- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.RUBY_VERSION }}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!-- replace '.programme-time' -->

<div class="column medium-2 programme-time">
<%= gpc_time_format start_time %><%= gpc_time_format end_time %>
<%= gpc_time_zone(start_time) %>
</div>
31 changes: 31 additions & 0 deletions spec/system/conference_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# frozen_string_literal: true

require "rails_helper"
require "selenium/webdriver"

describe "Visit a conference", type: :system do
let(:organization) { create :organization }
Expand Down Expand Up @@ -76,4 +77,34 @@
it_behaves_like "no links"
end
end

context "when conference program show" do
let(:organization) { create :organization, time_zone: "UTC" }
let!(:component) { create(:component, manifest_name: :meetings, participatory_space: conference) }
let!(:conference_speakers) { create_list(:conference_speaker, 3, :with_meeting, conference: conference, meetings_component: component) }
let(:meetings) { Decidim::ConferenceMeeting.where(component: component) }
let!(:user) { create(:user, :confirmed, organization: organization, time_zone: timezone) }
let(:timezone) { "CET" }

context "when the user is logged in" do
before do
sign_in user
visit decidim_conferences.conference_conference_program_path(conference, component)
end

it "shows user's time zone" do
expect(page).to have_content("CET")
end
end

context "when the user is not logged in" do
before do
visit decidim_conferences.conference_conference_program_path(conference, component)
end

it "shows the organization's time zone" do
expect(page).to have_content("UTC")
end
end
end
end

0 comments on commit 1ddf197

Please sign in to comment.