Upstream sync
This commit is contained in:
@@ -30,6 +30,24 @@ feature "Admin managing accounts" do
|
||||
expect(page).to have_content "Created at less than a minute ago"
|
||||
end
|
||||
|
||||
scenario "locks and unlocks account" do
|
||||
sign_in current_user
|
||||
visit admin_signed_in_root_path
|
||||
expect(Account.last.locked?).to eq false
|
||||
|
||||
click_button "Manage"
|
||||
expect(page).not_to have_content "Unlock Account"
|
||||
click_link "Lock Account"
|
||||
|
||||
expect(Account.last.locked?).to eq true
|
||||
|
||||
click_button "Manage"
|
||||
expect(page).not_to have_content "Lock Account"
|
||||
click_link "Unlock Account"
|
||||
|
||||
expect(Account.last.locked?).to eq false
|
||||
end
|
||||
|
||||
scenario "sees videos for an account in the system" do
|
||||
visit_account_overview_page
|
||||
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
require "rails_helper"
|
||||
|
||||
feature "Guest account sign up" do
|
||||
scenario "guest can select ME Suite PRO in 'interested in' dropdown" do
|
||||
visit new_account_path
|
||||
|
||||
expect(page).to have_selector("img[src*='ME_PRO_black']")
|
||||
select "ME Suite PRO", from: interested_in_product_dropdown
|
||||
end
|
||||
|
||||
scenario "creates a new account and signs in successfully" do
|
||||
visit new_account_path
|
||||
|
||||
@@ -38,4 +45,10 @@ feature "Guest account sign up" do
|
||||
|
||||
expect(page).to have_content "Sign Up"
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def interested_in_product_dropdown
|
||||
"user[interested_product_name]"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -684,6 +684,15 @@ feature 'User managing appearance releases' do
|
||||
expect(page).to have_selector("#top-person-photo[src^='#{person_photo_url}']")
|
||||
end
|
||||
|
||||
scenario "viewing the contract PDF - it shows person photo on first page if person photo is attached" do
|
||||
appearance_release = create(:appearance_release_with_contract_template, :native, :minor_with_guardian_photo, project: project)
|
||||
|
||||
visit view_release_pdf_html_preview_link_for(appearance_release)
|
||||
|
||||
person_photo_url = url_for(appearance_release.person_photo.variant(auto_orient: true, resize: "200x200")).to_s
|
||||
expect(page).to have_selector("#top-person-photo[src^='#{person_photo_url}']")
|
||||
end
|
||||
|
||||
scenario 'deleting a release', js: true do
|
||||
appearance_release = create(:appearance_release, project: project)
|
||||
|
||||
|
||||
@@ -151,6 +151,41 @@ feature 'User managing broadcasts' do
|
||||
end
|
||||
end
|
||||
|
||||
scenario 'broadcast recordings are shown in correct layout', js: true do
|
||||
broadcast = create(:broadcast, :with_stream, :with_files, project: project)
|
||||
create(:broadcast_recording, broadcast: broadcast, asset_uid: "asset_uid_1")
|
||||
|
||||
visit project_broadcast_path(project, broadcast)
|
||||
|
||||
expect(page).to have_selector("li.media")
|
||||
expect(page).to have_selector("div.play-thumbnail")
|
||||
expect(page).to have_selector("div.media-body")
|
||||
expect(page).to have_selector("div.play-btn")
|
||||
end
|
||||
|
||||
scenario 'active playing media has highlighted background (live take or recording)', js: true do
|
||||
broadcast = create(:broadcast, :with_stream, :with_files, project: project)
|
||||
create(:broadcast_recording, broadcast: broadcast, asset_uid: "asset_uid_1")
|
||||
create(:broadcast_recording, broadcast: broadcast, asset_uid: "asset_uid_2")
|
||||
|
||||
visit project_broadcast_path(project, broadcast)
|
||||
|
||||
expect(page).to have_selector("#live-take.playing-highlight")
|
||||
expect(page).to have_selector(".play-btn-svg", count: 3, visible: false)
|
||||
|
||||
first("[data-behavior='play_recording']").click
|
||||
|
||||
expect(page).not_to have_selector("#live-take.playing-highlight")
|
||||
expect(page).to have_selector("li.media.playing-highlight", count: 1)
|
||||
expect(page).to have_selector("li.media", count: 2)
|
||||
|
||||
first("[data-behavior='play_stream']").click
|
||||
|
||||
expect(page).to have_selector("#live-take.playing-highlight")
|
||||
expect(page).to have_selector("li.media", count: 2)
|
||||
expect(page).not_to have_selector("li.media.playing-highlight")
|
||||
end
|
||||
|
||||
context 'When the user is associate' do
|
||||
let(:current_user) { create(:user, :associate) }
|
||||
|
||||
|
||||
34
spec/features/user_managing_locked_account_spec.rb
Normal file
34
spec/features/user_managing_locked_account_spec.rb
Normal file
@@ -0,0 +1,34 @@
|
||||
require "rails_helper"
|
||||
|
||||
feature "User managing locked account" do
|
||||
let(:user) { create(:user, :account_manager) }
|
||||
let(:project) { create(:project) }
|
||||
|
||||
before do
|
||||
sign_in(user)
|
||||
user.accounts.first.update(locked: true)
|
||||
end
|
||||
|
||||
scenario "user is redirected to custom landing page when opens projects index page" do
|
||||
paths = [
|
||||
projects_path,
|
||||
project_path(project),
|
||||
project_task_requests_path(project),
|
||||
project_contract_templates_path(project),
|
||||
project_broadcasts_path(project),
|
||||
project_videos_path(project),
|
||||
]
|
||||
|
||||
paths.each do |path|
|
||||
visit path
|
||||
|
||||
expect(page).to have_content locked_account_warning
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def locked_account_warning
|
||||
t 'locked_accounts.index.account_locked_message'
|
||||
end
|
||||
end
|
||||
@@ -367,7 +367,7 @@ feature "User managing material releases" do
|
||||
expect(page).to have_content("No Media")
|
||||
|
||||
click_on "Manage"
|
||||
click_on "Add Media"
|
||||
click_on "Media"
|
||||
|
||||
expect(page).to have_content("Add Files")
|
||||
expect(page).to have_content("Apple MacBook Air")
|
||||
|
||||
@@ -197,13 +197,13 @@ feature "User managing medical releases" do
|
||||
expect(page).to have_css('i.fa.fa-check-circle.fa-2x', count: 1)
|
||||
end
|
||||
|
||||
scenario "Download All is visible" do
|
||||
scenario "Download button is visible" do
|
||||
create(:medical_release_with_contract_template, :native, project: project)
|
||||
create(:medical_release_with_contract_template, :non_native, project: project)
|
||||
|
||||
visit project_medical_releases_path(project)
|
||||
|
||||
expect(page).to have_content download_all_button
|
||||
expect(page).to have_content download_button
|
||||
end
|
||||
|
||||
scenario "Download action in Manage menu is visible" do
|
||||
@@ -285,7 +285,7 @@ feature "User managing medical releases" do
|
||||
|
||||
visit project_medical_releases_path(project)
|
||||
|
||||
expect(page).not_to have_content download_all_button
|
||||
expect(page).not_to have_content download_button
|
||||
end
|
||||
|
||||
scenario "Download action in Manage menu is not visible" do
|
||||
@@ -329,7 +329,7 @@ feature "User managing medical releases" do
|
||||
|
||||
visit project_medical_releases_path(project)
|
||||
|
||||
expect(page).not_to have_content download_all_button
|
||||
expect(page).not_to have_content download_button
|
||||
end
|
||||
|
||||
scenario "Download action in Manage menu is not visible" do
|
||||
@@ -362,8 +362,8 @@ feature "User managing medical releases" do
|
||||
|
||||
private
|
||||
|
||||
def download_all_button
|
||||
'Download All'
|
||||
def download_button
|
||||
'Download'
|
||||
end
|
||||
|
||||
def download_action
|
||||
|
||||
@@ -62,12 +62,12 @@ feature "User managing misc releases" do
|
||||
sign_in current_user
|
||||
end
|
||||
|
||||
scenario "Download All is visible" do
|
||||
scenario "Download is visible" do
|
||||
create(:misc_release_with_contract_template, :native, project: project)
|
||||
|
||||
visit project_misc_releases_path(project)
|
||||
|
||||
expect(page).to have_content download_all_button
|
||||
expect(page).to have_content download_button
|
||||
end
|
||||
|
||||
scenario "Downloading PDF of native misc release is possible" do
|
||||
@@ -165,8 +165,8 @@ feature "User managing misc releases" do
|
||||
|
||||
private
|
||||
|
||||
def download_all_button
|
||||
'Download All'
|
||||
def download_button
|
||||
'Download'
|
||||
end
|
||||
|
||||
def view_release_pdf_link_for(release)
|
||||
|
||||
Reference in New Issue
Block a user