Compare commits
1 Commits
API-can-fe
...
prevent-su
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9d160bb320 |
@@ -1,4 +1,4 @@
|
|||||||
<%= bootstrap_form_for model, layout: :inline, remote: true do |form| %>
|
<%= bootstrap_form_for model, layout: :inline, remote: true do |form| %>
|
||||||
<%= form.file_field :files, direct_upload: true, multiple: true, accept: "*", hide_label: true, wrapper_class: "w-65 mr-2", id: "broadcast_files_#{token}" %>
|
<%= form.file_field :files, direct_upload: true, multiple: true, accept: "*", hide_label: true, required: true, wrapper_class: "w-65 mr-2", id: "broadcast_files_#{token}" %>
|
||||||
<%= form.button fa_icon("upload", text: "Add File"), class: "btn btn-primary", type: :submit, data: { disable_with: fa_icon("spinner", text: "Adding File") } %>
|
<%= form.button fa_icon("upload", text: "Add File"), class: "btn btn-primary", type: :submit, data: { disable_with: fa_icon("spinner", text: "Adding File") } %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<%= bootstrap_form_for model, url: broadcast_url(token: token), layout: :inline, remote: true do |form| %>
|
<%= bootstrap_form_for model, url: broadcast_url(token: token), layout: :inline, remote: true do |form| %>
|
||||||
<%= form.file_field :files, direct_upload: true, multiple: true, accept: "*", hide_label: true, wrapper_class: "w-65 mr-2", id: "broadcast_files_#{token}" %>
|
<%= form.file_field :files, direct_upload: true, multiple: true, accept: "*", hide_label: true, required: true, wrapper_class: "w-65 mr-2", id: "broadcast_files_#{token}" %>
|
||||||
<%= form.button fa_icon("upload", text: "Add File"), class: "btn btn-primary", type: :submit, data: { disable_with: fa_icon("spinner", text: "Adding File") } %>
|
<%= form.button fa_icon("upload", text: "Add File"), class: "btn btn-primary", type: :submit, data: { disable_with: fa_icon("spinner", text: "Adding File") } %>
|
||||||
<% end %>
|
<% end %>
|
||||||
@@ -40,12 +40,12 @@ feature "User managing broadcasts" do
|
|||||||
scenario "visit show page of broadcast", js: true do
|
scenario "visit show page of broadcast", js: true do
|
||||||
broadcast = create(:broadcast, :with_stream, :with_files, project: project)
|
broadcast = create(:broadcast, :with_stream, :with_files, project: project)
|
||||||
recording = create(:broadcast_recording, broadcast: broadcast)
|
recording = create(:broadcast_recording, broadcast: broadcast)
|
||||||
|
|
||||||
visit project_broadcast_path(project, broadcast)
|
visit project_broadcast_path(project, broadcast)
|
||||||
|
|
||||||
expect(page).to have_content("Live stream is waiting to begin.")
|
expect(page).to have_content("Live stream is waiting to begin.")
|
||||||
expect(page).to have_content("Copy URL")
|
expect(page).to have_content("Copy URL")
|
||||||
|
|
||||||
within "#files" do
|
within "#files" do
|
||||||
expect(page).to have_content("contract.pdf")
|
expect(page).to have_content("contract.pdf")
|
||||||
end
|
end
|
||||||
@@ -54,6 +54,17 @@ feature "User managing broadcasts" do
|
|||||||
expect(page).to have_content(recording.download_file_name)
|
expect(page).to have_content(recording.download_file_name)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
scenario "form will not submit if user clicks Add files without selected files", js: true do
|
||||||
|
broadcast = create(:broadcast, :with_stream, :with_files, project: project)
|
||||||
|
|
||||||
|
visit project_broadcast_path(project, broadcast)
|
||||||
|
|
||||||
|
expect(page).to have_content("Live stream is waiting to begin.")
|
||||||
|
expect(page).to have_content add_file_button
|
||||||
|
|
||||||
|
click_on add_file_button
|
||||||
|
end
|
||||||
|
|
||||||
scenario "visit multi-view broadcast page", js: true do
|
scenario "visit multi-view broadcast page", js: true do
|
||||||
broadcast_one = create(:broadcast, :with_stream, :with_files, name: "Broadcast 1", project: project)
|
broadcast_one = create(:broadcast, :with_stream, :with_files, name: "Broadcast 1", project: project)
|
||||||
broadcast_two = create(:broadcast, :with_stream, :with_files, name: "Broadcast 2", project: project)
|
broadcast_two = create(:broadcast, :with_stream, :with_files, name: "Broadcast 2", project: project)
|
||||||
@@ -80,8 +91,13 @@ feature "User managing broadcasts" do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
def add_file_button
|
||||||
|
'Add File'
|
||||||
|
end
|
||||||
|
|
||||||
def broadcast_name_field
|
def broadcast_name_field
|
||||||
"broadcast[name]"
|
"broadcast[name]"
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user