Compare commits

..

10 Commits

Author SHA1 Message Date
Senad Uka
71ad502cc1 Taskme update 2020-06-30 05:08:23 +02:00
Senad Uka
1cd125382f Task me sync 2020-06-26 04:57:23 +02:00
Senad Uka
749aad3467 Task me upstream sync 2020-06-25 08:47:10 +02:00
Senad Uka
c167889ea3 Upstream sync task me mvp 2020-06-24 04:49:28 +02:00
Senad Uka
3e917c29f0 task me sync 2020-06-19 12:32:50 +02:00
Senad Uka
8ad89371b8 Task mvp upstream sync 2020-06-15 11:02:00 +02:00
Senad Uka
9d7e2c044a Upstream sync task me 2020-06-09 06:34:58 +02:00
Senad Uka
88836e937e Task me sync 2020-06-03 07:24:01 +02:00
bilal
e3d4d22a34 Handle QrMatching response - mock 2020-06-02 22:23:19 +02:00
Senad Uka
3690268f83 Sync of the branch 2020-06-01 18:59:15 +02:00
23 changed files with 68 additions and 352 deletions

View File

@@ -30,9 +30,9 @@ gem "active_storage_base64", "~> 1.0.0"
gem "image_processing", "~> 1.2" gem "image_processing", "~> 1.2"
# Use Amazon Web Services S3 for file uploads in production # Use Amazon Web Services S3 for file uploads in production
gem "aws-sdk-s3", "~> 1.48", require: false, group: [:production, :review] gem "aws-sdk-s3", "~> 1.31.0", require: false, group: [:production, :review]
# Allow AWS API requests to be signed using IAM credentials # Allow AWS API requests to be signed using IAM credentials
gem "aws-sigv4", "~> 1.1" gem "aws-sigv4", "~> 1.0.2"
# Reduces boot times through caching; required in config/boot.rb # Reduces boot times through caching; required in config/boot.rb
gem "bootsnap", ">= 1.1.0", require: false gem "bootsnap", ">= 1.1.0", require: false

View File

@@ -117,22 +117,21 @@ GEM
ast (2.4.0) ast (2.4.0)
autoprefixer-rails (9.7.3) autoprefixer-rails (9.7.3)
execjs execjs
aws-eventstream (1.1.0) aws-eventstream (1.0.3)
aws-partitions (1.337.0) aws-partitions (1.210.0)
aws-sdk-core (3.102.1) aws-sdk-core (3.46.2)
aws-eventstream (~> 1, >= 1.0.2) aws-eventstream (~> 1.0)
aws-partitions (~> 1, >= 1.239.0) aws-partitions (~> 1.0)
aws-sigv4 (~> 1.1) aws-sigv4 (~> 1.0)
jmespath (~> 1.0) jmespath (~> 1.0)
aws-sdk-kms (1.35.0) aws-sdk-kms (1.13.0)
aws-sdk-core (~> 3, >= 3.99.0) aws-sdk-core (~> 3, >= 3.39.0)
aws-sigv4 (~> 1.1) aws-sigv4 (~> 1.0)
aws-sdk-s3 (1.72.0) aws-sdk-s3 (1.31.0)
aws-sdk-core (~> 3, >= 3.102.1) aws-sdk-core (~> 3, >= 3.39.0)
aws-sdk-kms (~> 1) aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.1) aws-sigv4 (~> 1.0)
aws-sigv4 (1.2.1) aws-sigv4 (1.0.3)
aws-eventstream (~> 1, >= 1.0.2)
axlsx (3.0.0.pre) axlsx (3.0.0.pre)
htmlentities (~> 4.3, >= 4.3.4) htmlentities (~> 4.3, >= 4.3.4)
mimemagic (~> 0.3) mimemagic (~> 0.3)
@@ -515,8 +514,8 @@ DEPENDENCIES
activeresource (= 5.1.0) activeresource (= 5.1.0)
acts-as-taggable-on! acts-as-taggable-on!
analytics-ruby analytics-ruby
aws-sdk-s3 (~> 1.48) aws-sdk-s3 (~> 1.31.0)
aws-sigv4 (~> 1.1) aws-sigv4 (~> 1.0.2)
axlsx (~> 3.0.0.pre) axlsx (~> 3.0.0.pre)
axlsx_rails (~> 0.5.2) axlsx_rails (~> 0.5.2)
axlsx_styler (~> 0.2.0) axlsx_styler (~> 0.2.0)

View File

@@ -17,7 +17,7 @@ class AccountsController < ApplicationController
if sign_in(user) if sign_in(user)
TrackAnalyticsJob.perform_later(user, user.primary_account, :track_guest_sign_up, user_agent: request.user_agent, user_ip: request.remote_ip) TrackAnalyticsJob.perform_later(user, user.primary_account, :track_guest_sign_up, user_agent: request.user_agent, user_ip: request.remote_ip)
SubmitHubspotFormJob.perform_later(user.first_name, user.last_name, user.email, account.name, i_m_interested_in: user.interested_product_name) SubmitHubspotFormJob.perform_later(user.email, account.name, i_m_interested_in: user.interested_product_name)
redirect_to signed_in_root_path redirect_to signed_in_root_path
else else
redirect_to new_session_path, alert: t(".notice") redirect_to new_session_path, alert: t(".notice")

View File

@@ -19,11 +19,5 @@ class Api::AppearanceReleasesController < Api::ReleasesController
guardian_photo[:io] = StringIO.new(Base64.decode64(guardian_photo[:io])) guardian_photo[:io] = StringIO.new(Base64.decode64(guardian_photo[:io]))
release.guardian_photo.attach(io: guardian_photo[:io], filename: guardian_photo[:filename]) release.guardian_photo.attach(io: guardian_photo[:io], filename: guardian_photo[:filename])
end end
guardian_2_photo = release_create_params[:guardian_2_photo]
if guardian_2_photo
guardian_2_photo[:io] = StringIO.new(Base64.decode64(guardian_2_photo[:io]))
release.guardian_2_photo.attach(io: guardian_2_photo[:io], filename: guardian_2_photo[:filename])
end
end end
end end

View File

@@ -103,16 +103,10 @@ class Api::ReleasesController < Api::ApiController
if ["appearance_release", "talent_release"].include?(name) if ["appearance_release", "talent_release"].include?(name)
has_many :guardian_photos do has_many :guardian_photos do
data do data do
[ [@object.guardian_photo.try(:attachment)].compact
@object.guardian_photo.try(:attachment),
@object.guardian_2_photo.try(:attachment)
].compact
end end
meta do meta do
{ count: { count: @object.try(:guardian_photo).try(:attached?) ? 1 : 0 }
(@object.try(:guardian_photo).try(:attached?) ? 1 : 0) +
(@object.try(:guardian_2_photo).try(:attached?) ? 1 : 0)
}
end end
end end
end end
@@ -176,7 +170,7 @@ class Api::ReleasesController < Api::ApiController
def release_create_params def release_create_params
parameters = params.require(model_name).permit! parameters = params.require(model_name).permit!
keys = model_constant.new.attributes.keys + [:guardian_photo, :guardian_2_photo, :person_photo, :photos, :signature, :signature_base64, :file_infos_attributes] keys = model_constant.new.attributes.keys + [:guardian_photo, :person_photo, :photos, :signature, :signature_base64, :file_infos_attributes]
parameters[:signature_base64] = parameters[:signature] parameters[:signature_base64] = parameters[:signature]
parameters = parameters.slice(*keys).except(:created_at, :updated_at, :id, :user_id, :signature) parameters = parameters.slice(*keys).except(:created_at, :updated_at, :id, :user_id, :signature)
parameters parameters

View File

@@ -17,11 +17,5 @@ class Api::TalentReleasesController < Api::ReleasesController
guardian_photo[:io] = StringIO.new(Base64.decode64(guardian_photo[:io])) guardian_photo[:io] = StringIO.new(Base64.decode64(guardian_photo[:io]))
release.guardian_photo.attach(io: guardian_photo[:io], filename: guardian_photo[:filename]) release.guardian_photo.attach(io: guardian_photo[:io], filename: guardian_photo[:filename])
end end
guardian_2_photo = release_create_params[:guardian_2_photo]
if guardian_2_photo
guardian_2_photo[:io] = StringIO.new(Base64.decode64(guardian_2_photo[:io]))
release.guardian_2_photo.attach(io: guardian_2_photo[:io], filename: guardian_2_photo[:filename])
end
end end
end end

View File

@@ -7,7 +7,6 @@ class ContractTemplatesController < ApplicationController
before_action :set_project, except: [:destroy] before_action :set_project, except: [:destroy]
before_action :set_contract_template, only: [:destroy] before_action :set_contract_template, only: [:destroy]
before_action :show_splash_screen, only: :index
def index def index
@contract_templates = contract_templates.non_archived.order_by_name.paginate(page: params[:page]) @contract_templates = contract_templates.non_archived.order_by_name.paginate(page: params[:page])
@@ -39,10 +38,6 @@ class ContractTemplatesController < ApplicationController
private private
def show_splash_screen
render :splash if contract_templates.non_archived.count.zero?
end
def set_contract_template def set_contract_template
@contract_template = authorize contract_templates.find(params[:id]) @contract_template = authorize contract_templates.find(params[:id])
end end

View File

@@ -60,14 +60,9 @@ class StreamNotificationsController < ApplicationController
def set_broadcast def set_broadcast
if notification_type == "video.asset.static_renditions.ready" if notification_type == "video.asset.static_renditions.ready"
live_stream_id = notification.dig(:stream_notification, :data, :live_stream_id) live_stream_id = notification.dig(:stream_notification, :data, :live_stream_id)
@broadcast = Broadcast.find_by(stream_uid: live_stream_id) @broadcast = Broadcast.find_by!(stream_uid: live_stream_id)
else else
@broadcast = Broadcast.find_by(stream_uid: notification_object_id) @broadcast = Broadcast.find_by!(stream_uid: notification_object_id)
end
if @broadcast.nil?
logger.info "Ignoring broadcast from other environment. Type = #{notification_type}. Id = #{live_stream_id} / #{notification_object_id}"
head :ok
end end
end end

View File

@@ -13,13 +13,10 @@ module WordmarkHelper
css += options[:class].to_s css += options[:class].to_s
content_tag(:div, class: css) do content_tag(:div, class: css) do
elements = [ safe_join [
content_tag(:span, t("shared.#{product_name}")), content_tag(:span, t("shared.#{product_name}")),
content_tag(:span, t("shared.me")) content_tag(:span, t("shared.me"))
] ]
prefix = options[:prefix]
elements.unshift content_tag(:span, "#{prefix} ") unless prefix.blank?
safe_join elements
end end
end end
end end

View File

@@ -1,14 +1,12 @@
class SubmitHubspotFormJob < ApplicationJob class SubmitHubspotFormJob < ApplicationJob
queue_as :default queue_as :default
def perform(first_name, last_name, email, company_name, additional_params = {}) def perform(email, company_name, additional_params = {})
hubspot_form_guid = ENV["HUBSPOT_FORM_GUID"] hubspot_form_guid = ENV["HUBSPOT_FORM_GUID"]
return unless hubspot_form_guid.present? return unless hubspot_form_guid.present?
submission_params = { submission_params = {
first_name: first_name, email: email,
last_name: last_name,
email: email,
company: company_name company: company_name
}.merge(additional_params) }.merge(additional_params)

View File

@@ -1,58 +0,0 @@
<div class="d-flex flex-row">
<div class="d-flex flex-column">
<%= product_wordmark :release_me, prefix: t('.headings.welcome'), class: "h2" %>
<p class="text-muted"><%= t '.headings.subtitle' %>
</div>
<%= link_to t(".actions.book_demo"), 'https://meetings.hubspot.com/bray2', class: "btn btn-primary border align-self-center h-50 ml-auto mr-2 pb-2", target: '_blank' %>
<% if policy(ContractTemplate).new? %>
<%= link_to t(".actions.create_template"), [:new, @project, :contract_template], class: "btn btn-success border align-self-center h-50 pb-2" %>
<% end %>
</div>
<hr>
<div class="pt-2">
<div class="row">
<div class="col">
<div class="card-body p-0">
<div class="embed-responsive embed-responsive-16by9">
<div class="embed-responsive-item">
<table class="w-100 h-100 bg-secondary">
<tbody>
<tr>
<td class="text-center align-middle text-white">
Video tutorial will be available soon
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="col">
<div class="row">
<div class="col">
<h3><%= t '.headings.how_it_works' %></h3>
<ol>
<li><%= t '.list_items.create_releases' %></li>
<li><%= t '.list_items.download_mobile_app' %></li>
<li><%= t '.list_items.print_QR_code' %></li>
<li><%= t '.list_items.releases_automatically_organized' %></li>
</ol>
</div>
</div>
<div class="row">
<div class="col">
<h3><%= t '.headings.benefits' %></h3>
<ul class="fa-ul ml-5">
<%= content_tag(:li, fa_icon("check li", text: t('.list_items.all_releases_available'))) %>
<%= content_tag(:li, fa_icon("check li", text: t('.list_items.manage_large_audience'))) %>
<%= content_tag(:li, fa_icon("check li", text: t('.list_items.add_tags_and_notes'))) %>
</ul>
</div>
</div>
</div>
</div>
</div>

View File

@@ -252,23 +252,6 @@ en:
signed_release_count: No. Signed Releases signed_release_count: No. Signed Releases
new: new:
heading: New Release Template heading: New Release Template
splash:
actions:
book_demo: Schedule a Demo
create_template: Create New Release Template
headings:
benefits: Benefits
how_it_works: How It Works
subtitle: The easiest way to create and manage releases.
welcome: Welcome to
list_items:
add_tags_and_notes: Add tags and notes to releases for added organization and searchability
all_releases_available: All release types available including Covid Medical, Appearance, Location and more
create_releases: Create releases for your video shoot
download_mobile_app: Download the ME Suite mobile app
manage_large_audience: Easily manage large audiences with the crowd control feature
print_QR_code: Print out release QR codes
releases_automatically_organized: Releases are automatically organized as theyre submitted
contracts: contracts:
medical_questionnaire: medical_questionnaire:
heading: Medical Questionnaire heading: Medical Questionnaire
@@ -341,11 +324,11 @@ en:
notice: The release has been updated notice: The release has been updated
helpers: helpers:
help: help:
task_request:
time_allowed: Minimum of 2 hours, no partial hours allowed
contract_template: contract_template:
fee: Leave at $0.00 for no-fee fee: Leave at $0.00 for no-fee
guardian_clause: Leave blank if not required for this contract guardian_clause: Leave blank if not required for this contract
task_request:
time_allowed: Minimum of 2 hours, no partial hours allowed
video: video:
audio_only_edl_file: If you do not upload an Audio Only EDL, the software will not generate a BiG Music Cue Sheet. audio_only_edl_file: If you do not upload an Audio Only EDL, the software will not generate a BiG Music Cue Sheet.
edl_file: Please follow our directions on exporting the All Tracks EDL. Failure to do so could result in inaccurate and incomplete reporting. edl_file: Please follow our directions on exporting the All Tracks EDL. Failure to do so could result in inaccurate and incomplete reporting.

View File

@@ -70,23 +70,6 @@ es:
heading: Legal (ES) heading: Legal (ES)
release_info: release_info:
heading: Release Info (ES) heading: Release Info (ES)
splash:
actions:
book_demo: Schedule a Demo (ES)
create_template: Create New Release Template (ES)
headings:
benefits: ""
how_it_works: How It Works (ES)
subtitle: The easiest way to create and manage releases. (ES)
welcome: Welcome to (ES)
list_items:
add_tags_and_notes: Add tags and notes to releases for added organization and searchability (ES)
all_releases_available: All release types available including Covid Medical, Appearance, Location and more (ES)
create_releases: Create releases for your video shoot (ES)
download_mobile_app: Download the ME Suite mobile app (ES)
manage_large_audience: Easily manage large audiences with the crowd control feature (ES)
print_QR_code: Print out release QR codes (ES)
releases_automatically_organized: Releases are automatically organized as theyre submitted (ES)
contracts: contracts:
photos: photos:
guardian_2_photo_heading: Second guardian photo (ES) guardian_2_photo_heading: Second guardian photo (ES)

View File

@@ -57,8 +57,6 @@ RSpec.describe AccountsController, type: :controller do
expect { expect {
post :create, params: params post :create, params: params
}.to have_enqueued_job(SubmitHubspotFormJob).with( }.to have_enqueued_job(SubmitHubspotFormJob).with(
"John",
"Doe",
"test_user+1@test.com", "test_user+1@test.com",
"Test Dev account", "Test Dev account",
i_m_interested_in: "DirectME" i_m_interested_in: "DirectME"

View File

@@ -37,26 +37,23 @@ RSpec.describe Api::AppearanceReleasesController, type: :controller do
it 'includes photos' do it 'includes photos' do
project = create(:project, account_id: current_user.primary_account.id) project = create(:project, account_id: current_user.primary_account.id)
appearance_release = create(:appearance_release, appearance_release = create(:appearance_release, person_first_name: 'Release', person_last_name: 'Name', project: project)
:with_person_photo, :with_guardian_photo, :with_guardian_2_photo,
project: project)
sign_in_to_api(current_user) sign_in_to_api(current_user)
get :show, params: { id: appearance_release.id } get :show, params: { id: appearance_release.id }
[appearance_release.person_photo, appearance_release.guardian_photo, appearance_release.guardian_2_photo].each do |photo| photo = appearance_release.person_photo
data = { data = {
'id' => photo.id.to_s, 'id' => photo.id.to_s,
'type' => 'active_storage_attachment', 'type' => 'active_storage_attachment',
'attributes' => { 'attributes' => {
'content_type' => photo.content_type, 'content_type' => photo.content_type,
'filename' => photo.filename.to_s, 'filename' => photo.filename.to_s,
'url' => photo_path_for(photo), 'url' => photo_path_for(photo),
'thumbnail_url' => photo_variant_path_for(photo, '150x150') 'thumbnail_url' => photo_variant_path_for(photo, '150x150')
}
} }
expect(response_body_included_attributes).to include(data) }
end expect(response_body_included_attributes).to include(data)
end end
end end
@@ -187,46 +184,7 @@ RSpec.describe Api::AppearanceReleasesController, type: :controller do
expect(appearance_release.guardian_photo).to be_attached expect(appearance_release.guardian_photo).to be_attached
end end
it 'returns 201 for minor without second guardian photo' do
post :create, params: @parameters.deep_merge(appearance_release: {
minor: true,
guardian_2_name: 'Guardian 2 Name',
guardian_2_phone: '101010',
})
expect(response.status).to eq 201
expect(AppearanceRelease.last.signature).to be_attached
expect(AppearanceRelease.last.guardian_2_photo).not_to be_attached
end
it 'returns 201 for minor with second guardian photo' do
post :create, params: @parameters.deep_merge(appearance_release: {
minor: true,
guardian_2_name: 'Guardian 2 Name',
guardian_2_phone: '101010',
guardian_2_photo: {
io: guardian_photo_base64,
filename: 'guardian_2_photo.jpeg'
}
})
expect(response.status).to eq 201
appearance_release = AppearanceRelease.last
photo = appearance_release.guardian_2_photo
data = {
'id' => photo.id.to_s,
'type' => 'active_storage_attachment',
'attributes' => {
'content_type' => photo.content_type,
'filename' => photo.filename.to_s,
'url' => photo_path_for(photo),
'thumbnail_url' => photo_variant_path_for(photo, '150x150')
}
}
expect(response_body_included_attributes).to include(data)
expect(appearance_release.signature).to be_attached
expect(appearance_release.guardian_2_photo).to be_attached
end
end end
private private

View File

@@ -32,28 +32,26 @@ RSpec.describe Api::TalentReleasesController, type: :controller do
end end
it 'includes photos' do it 'includes photos' do
project = create(:project, account_id: current_user.primary_account.id) tested_release = create("talent_release_with_photo", person_name: 'Release 1', project: project)
talent_release = create(:talent_release,
:with_guardian_photo, :with_guardian_2_photo,
project: project)
sign_in_to_api(current_user) sign_in_to_api(current_user)
get :show, params: { id: talent_release.id } get :show, params: { id: tested_release.id }
[talent_release.photos, talent_release.guardian_photo, talent_release.guardian_2_photo].flatten.each do |photo| tested_release.photos.each do |photo|
data = { data = {
'id' => photo.id.to_s, 'id' => photo.id.to_s,
'type' => 'active_storage_attachment', 'type' => 'active_storage_attachment',
'attributes' => { 'attributes' => {
'content_type' => photo.content_type, 'content_type' => photo.content_type,
'filename' => photo.filename.to_s, 'filename' => photo.filename.to_s,
'url' => photo_path_for(photo), 'url' => photo_path_for(photo),
'thumbnail_url' => photo_variant_path_for(photo, '150x150') 'thumbnail_url' => photo_variant_path_for(photo, '150x150')
} }
} }
expect(response_body_included_attributes).to include(data)
end expect(response_body_included_attributes).to include(data)
end end
end
end end
describe '#create' do describe '#create' do
@@ -182,47 +180,6 @@ RSpec.describe Api::TalentReleasesController, type: :controller do
expect(talent_release.signature).to be_attached expect(talent_release.signature).to be_attached
expect(talent_release.guardian_photo).to be_attached expect(talent_release.guardian_photo).to be_attached
end end
it 'returns 201 for minor without second guardian photo' do
post :create, params: @parameters.deep_merge(talent_release: {
minor: true,
guardian_2_name: 'Guardian 2 Name',
guardian_2_phone: '101010',
})
expect(response.status).to eq 201
expect(TalentRelease.last.signature).to be_attached
expect(TalentRelease.last.guardian_2_photo).not_to be_attached
end
it 'returns 201 for minor with second guardian photo' do
post :create, params: @parameters.deep_merge(talent_release: {
minor: true,
guardian_2_name: 'Guardian 2 Name',
guardian_2_phone: '101010',
guardian_2_photo: {
io: guardian_photo_base64,
filename: 'guardian_2_photo.jpeg'
}
})
expect(response.status).to eq 201
talent_release = TalentRelease.last
photo = talent_release.guardian_2_photo
data = {
'id' => photo.id.to_s,
'type' => 'active_storage_attachment',
'attributes' => {
'content_type' => photo.content_type,
'filename' => photo.filename.to_s,
'url' => photo_path_for(photo),
'thumbnail_url' => photo_variant_path_for(photo, '150x150')
}
}
expect(response_body_included_attributes).to include(data)
expect(talent_release.signature).to be_attached
expect(talent_release.guardian_2_photo).to be_attached
end
end end
private private

View File

@@ -19,7 +19,7 @@ describe ContractTemplatesController do
expect(response).to be_successful expect(response).to be_successful
end end
it 'renders content if there are contract templates' do it 'renders content' do
contract_template = create(:contract_template, contract_template = create(:contract_template,
name: 'My Contract Template', fee: 50, release_type: 'appearance', name: 'My Contract Template', fee: 50, release_type: 'appearance',
project: project) project: project)
@@ -39,11 +39,10 @@ describe ContractTemplatesController do
end end
context 'when there are no contract templates' do context 'when there are no contract templates' do
it 'renders splash screen' do it 'renders an empty message' do
get :index, params: { project_id: project } get :index, params: { project_id: project }
expect(response.body).to have_link "Create New Release Template" expect(response.body).to have_content('Release Templates will appear here')
expect(response.body).to have_link schedule_demo
end end
end end
@@ -51,7 +50,6 @@ describe ContractTemplatesController do
let(:current_user) { create(:user, :associate) } let(:current_user) { create(:user, :associate) }
it 'does not show the new contract template button' do it 'does not show the new contract template button' do
create(:contract_template, project: project)
get :index, params: { project_id: project } get :index, params: { project_id: project }
expect(response.body).not_to have_link('Create New Release Template') expect(response.body).not_to have_link('Create New Release Template')
@@ -168,8 +166,4 @@ describe ContractTemplatesController do
restriction_text: 'restrictions' restriction_text: 'restrictions'
} }
end end
def schedule_demo
t 'contract_templates.splash.actions.book_demo'
end
end end

View File

@@ -7,7 +7,6 @@ RSpec.describe StreamNotificationsController, type: :controller do
let(:active_status) { {type: "video.live_stream.active", object: { id: "mux_stream" }} } let(:active_status) { {type: "video.live_stream.active", object: { id: "mux_stream" }} }
let(:disconnected_status) { {type: "video.live_stream.disconnected", object: { id: "mux_stream" }} } let(:disconnected_status) { {type: "video.live_stream.disconnected", object: { id: "mux_stream" }} }
let(:idle_status) { {type: "video.live_stream.idle", object: { id: "mux_stream" }} } let(:idle_status) { {type: "video.live_stream.idle", object: { id: "mux_stream" }} }
let(:idle_status_for_unknown_broadcast) { {type: "video.live_stream.idle", object: { id: "unknown-id" }} }
let(:asset_ready) { { let(:asset_ready) { {
type: "video.asset.static_renditions.ready", type: "video.asset.static_renditions.ready",
object: { id: "asset_uid" }, object: { id: "asset_uid" },
@@ -60,12 +59,6 @@ RSpec.describe StreamNotificationsController, type: :controller do
expect(BroadcastsChannel).to have_received(:stream_recording_ready) expect(BroadcastsChannel).to have_received(:stream_recording_ready)
end end
it "returns OK response even for non-existing broadcast" do
post :create, params: idle_status_for_unknown_broadcast
expect(response).to be_successful
end
end end
after do after do

View File

@@ -58,7 +58,10 @@ FactoryBot.define do
guardian_address_state "State" guardian_address_state "State"
guardian_address_zip "ZIP" guardian_address_zip "ZIP"
guardian_address_country "Country" guardian_address_country "Country"
with_guardian_photo guardian_photo do
path = Rails.root.join("spec", "fixtures", "files", "pratt.jpg")
Rack::Test::UploadedFile.new(path, "image/jpeg")
end
end end
trait :without_person_photo do trait :without_person_photo do
@@ -71,20 +74,6 @@ FactoryBot.define do
end end
end end
trait :with_guardian_photo do
guardian_photo do
path = Rails.root.join("spec", "fixtures", "files", "pratt.jpg")
Rack::Test::UploadedFile.new(path, "image/jpeg")
end
end
trait :with_guardian_2_photo do
guardian_2_photo do
path = Rails.root.join("spec", "fixtures", "files", "pratt.jpg")
Rack::Test::UploadedFile.new(path, "image/jpeg")
end
end
trait :with_person_photo_only do trait :with_person_photo_only do
end end

View File

@@ -35,23 +35,12 @@ FactoryBot.define do
guardian_first_name "Jamie" guardian_first_name "Jamie"
guardian_last_name "Doe" guardian_last_name "Doe"
guardian_phone "123-555-1234" guardian_phone "123-555-1234"
with_guardian_photo
end
trait :with_guardian_photo do
guardian_photo do guardian_photo do
path = Rails.root.join("spec", "fixtures", "files", "pratt.jpg") path = Rails.root.join("spec", "fixtures", "files", "pratt.jpg")
Rack::Test::UploadedFile.new(path, "image/jpeg") Rack::Test::UploadedFile.new(path, "image/jpeg")
end end
end end
trait :with_guardian_2_photo do
guardian_2_photo do
path = Rails.root.join("spec", "fixtures", "files", "pratt.jpg")
Rack::Test::UploadedFile.new(path, "image/jpeg")
end
end
factory :talent_release_with_contract_template do factory :talent_release_with_contract_template do
after(:build) do |talent_release, _| after(:build) do |talent_release, _|
talent_release.contract_template = build(:talent_release_contract_template) talent_release.contract_template = build(:talent_release_contract_template)

View File

@@ -13,7 +13,6 @@ feature "User imports release templates", type: :feature do
end end
scenario "importing two existing templates into a project" do scenario "importing two existing templates into a project" do
create(:contract_template, project: project)
visit project_contract_templates_path(project) visit project_contract_templates_path(project)
click_on "Import Release Template" click_on "Import Release Template"
select_templates([project_one_template.id, project_two_template.id]) select_templates([project_one_template.id, project_two_template.id])
@@ -32,7 +31,6 @@ feature "User imports release templates", type: :feature do
end end
scenario "searching for a template", js: true do scenario "searching for a template", js: true do
create(:contract_template, project: project)
visit project_contract_templates_path(project) visit project_contract_templates_path(project)
click_on "Import Release Template" click_on "Import Release Template"
fill_in "query", with: "Second" fill_in "query", with: "Second"

View File

@@ -11,13 +11,6 @@ RSpec.feature 'User manages contract templates', type: :feature do
sign_in(current_user) sign_in(current_user)
end end
scenario 'splash page is shown if tehre are no contract templates' do
visit project_contract_templates_path(project)
expect(page).to have_content schedule_demo
expect(page).to have_content create_release_template
end
scenario 'creating a new release template' do scenario 'creating a new release template' do
visit new_project_contract_template_path(project) visit new_project_contract_template_path(project)
@@ -230,20 +223,12 @@ RSpec.feature 'User manages contract templates', type: :feature do
let(:current_user) { create(:user, :associate) } let(:current_user) { create(:user, :associate) }
it 'does not show management buttons for release templates' do it 'does not show management buttons for release templates' do
create(:contract_template, project: project)
visit project_contract_templates_path(project) visit project_contract_templates_path(project)
expect(page).not_to have_content('Create New Release Template') expect(page).not_to have_content('Create New Release Template')
expect(page).not_to have_content(import_template_button) expect(page).not_to have_content(import_template_button)
expect(page).not_to have_content('Delete') expect(page).not_to have_content('Delete')
end end
it 'does not show create release button on splash page' do
visit project_contract_templates_path(project)
expect(page).to have_content schedule_demo
expect(page).not_to have_content create_release_template
end
end end
context 'When the user is account manager' do context 'When the user is account manager' do
@@ -257,13 +242,6 @@ RSpec.feature 'User manages contract templates', type: :feature do
click_on 'Manage' click_on 'Manage'
expect(page).to have_content('Archive') expect(page).to have_content('Archive')
end end
it 'does not show create release button on splash page' do
visit project_contract_templates_path(project)
expect(page).to have_content schedule_demo
expect(page).to have_content create_release_template
end
end end
private private
@@ -295,12 +273,4 @@ RSpec.feature 'User manages contract templates', type: :feature do
def fill_hidden(id, with:) def fill_hidden(id, with:)
find(:xpath, "//input[@id='#{id}']", visible: false).set with find(:xpath, "//input[@id='#{id}']", visible: false).set with
end end
def schedule_demo
t 'contract_templates.splash.actions.book_demo'
end
def create_release_template
t 'contract_templates.splash.actions.create_template'
end
end end

View File

@@ -11,12 +11,10 @@ RSpec.describe SubmitHubspotFormJob, type: :job do
allow(Hubspot::Form).to receive(:new).and_return(form) allow(Hubspot::Form).to receive(:new).and_return(form)
allow(form).to receive(:submit).and_return(true) allow(form).to receive(:submit).and_return(true)
SubmitHubspotFormJob.perform_now("John", "Doe", "email@test.com", "My Account") SubmitHubspotFormJob.perform_now("email@test.com", "My Account")
expect(Hubspot::Form).to have_received(:new).with("guid" => "hubspot_form_guid") expect(Hubspot::Form).to have_received(:new).with("guid" => "hubspot_form_guid")
expect(form).to have_received(:submit).with( expect(form).to have_received(:submit).with(
first_name: "John",
last_name: "Doe",
email: "email@test.com", email: "email@test.com",
company: "My Account" company: "My Account"
) )
@@ -27,11 +25,9 @@ RSpec.describe SubmitHubspotFormJob, type: :job do
allow(Hubspot::Form).to receive(:new).and_return(form) allow(Hubspot::Form).to receive(:new).and_return(form)
allow(form).to receive(:submit).and_return(true) allow(form).to receive(:submit).and_return(true)
SubmitHubspotFormJob.perform_now("John", "Doe", "email@test.com", "My Account", additional_param_one: "Foo", additional_param_two: "Bar") SubmitHubspotFormJob.perform_now("email@test.com", "My Account", additional_param_one: "Foo", additional_param_two: "Bar")
expect(form).to have_received(:submit).with( expect(form).to have_received(:submit).with(
first_name: "John",
last_name: "Doe",
email: "email@test.com", email: "email@test.com",
company: "My Account", company: "My Account",
additional_param_one: "Foo", additional_param_one: "Foo",
@@ -46,7 +42,7 @@ RSpec.describe SubmitHubspotFormJob, type: :job do
allow(Hubspot::Form).to receive(:new).and_return(form) allow(Hubspot::Form).to receive(:new).and_return(form)
allow(form).to receive(:submit) allow(form).to receive(:submit)
SubmitHubspotFormJob.perform_now("John", "Doe", "email@test.com", "My Account") SubmitHubspotFormJob.perform_now("email@test.com", "My Account")
expect(form).not_to have_received(:submit) expect(form).not_to have_received(:submit)
end end