Compare commits
1 Commits
prevent-fo
...
prevent-su
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9d160bb320 |
@@ -1,4 +1,4 @@
|
||||
<%= 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") } %>
|
||||
<% end %>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<%= 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") } %>
|
||||
<% end %>
|
||||
@@ -40,12 +40,12 @@ feature "User managing broadcasts" do
|
||||
scenario "visit show page of broadcast", js: true do
|
||||
broadcast = create(:broadcast, :with_stream, :with_files, project: project)
|
||||
recording = create(:broadcast_recording, broadcast: broadcast)
|
||||
|
||||
|
||||
visit project_broadcast_path(project, broadcast)
|
||||
|
||||
expect(page).to have_content("Live stream is waiting to begin.")
|
||||
expect(page).to have_content("Copy URL")
|
||||
|
||||
|
||||
within "#files" do
|
||||
expect(page).to have_content("contract.pdf")
|
||||
end
|
||||
@@ -54,6 +54,17 @@ feature "User managing broadcasts" do
|
||||
expect(page).to have_content(recording.download_file_name)
|
||||
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
|
||||
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)
|
||||
@@ -80,8 +91,13 @@ feature "User managing broadcasts" do
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
private
|
||||
|
||||
def add_file_button
|
||||
'Add File'
|
||||
end
|
||||
|
||||
def broadcast_name_field
|
||||
"broadcast[name]"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user