-
Notifications
You must be signed in to change notification settings - Fork 21
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
Showing
7 changed files
with
87 additions
and
1 deletion.
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
6 changes: 6 additions & 0 deletions
6
app/assets/stylesheets/layouts/publishers/vacancies/summary.scss
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,6 @@ | ||
.publishers_vacancies_summary { | ||
.copy-button { | ||
margin-top: 28px; | ||
vertical-align: bottom; | ||
} | ||
} |
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,7 @@ | ||
a target="_blank" rel="noopener noreferrer external" class="govuk-link govuk-link--no-underline" href="https://www.facebook.com/sharer/sharer.php?u=#{url_encode(target_url)}" | ||
span.govuk-link-image | ||
svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" focusable="false" width="24" height="24" | ||
path fill="currentColor" d="M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z" | ||
= text | ||
span class="govuk-visually-hidden" | ||
= t("app.opens_in_new_tab", link_text: nil) |
7 changes: 7 additions & 0 deletions
7
app/views/publishers/vacancies/base/_twitter_x_link.html.slim
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,7 @@ | ||
a target="_blank" rel="noopener noreferrer external" class="govuk-link govuk-link--no-underline" href="https://www.x.com/share?url=#{url_encode(target_url)}" | ||
span.govuk-link-image | ||
svg viewBox="0 0 1200 1227" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" width="24" height="24" | ||
path fill="currentColor" d="M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z" | ||
= text | ||
span class="govuk-visually-hidden" | ||
= t("app.opens_in_new_tab", link_text: nil) |
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
35 changes: 35 additions & 0 deletions
35
spec/system/publishers/publishers_can_copy_and_promote_job_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,35 @@ | ||
require "rails_helper" | ||
|
||
RSpec.describe "Publishers can copy and promote job" do | ||
let(:publisher) { create(:publisher) } | ||
let(:organisation) { create(:school) } | ||
let(:vacancy) { create(:vacancy, :draft, organisations: [organisation], publisher: publisher, publish_on: publish_on) } | ||
let(:share_page_content) { I18n.t("publishers.vacancies.summary.share_page_url") } | ||
|
||
before do | ||
login_publisher(publisher: publisher, organisation: organisation) | ||
visit organisation_job_review_path(vacancy.id) | ||
end | ||
|
||
after do | ||
logout | ||
end | ||
|
||
context "when the vacancy is published today" do | ||
let(:publish_on) { Date.current } | ||
|
||
it "shows the share link" do | ||
click_on I18n.t("publishers.vacancies.show.heading_component.action.publish") | ||
expect(page).to have_content(share_page_content) | ||
end | ||
end | ||
|
||
context "when the vacancy is published tomorrow" do | ||
let(:publish_on) { Date.tomorrow } | ||
|
||
it "doesnt show the share link" do | ||
click_on I18n.t("publishers.vacancies.show.heading_component.action.scheduled_complete_draft") | ||
expect(page).not_to have_content(share_page_content) | ||
end | ||
end | ||
end |