Compare commits
1 Commits
big-admin-
...
highlight-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a26cbc6bb8 |
@@ -1,5 +1,6 @@
|
|||||||
$(document).on("turbolinks:load", () => {
|
$(document).on("turbolinks:load", () => {
|
||||||
$('.datepicker-control').datepicker({
|
$('.datepicker-control').datepicker({
|
||||||
format: "yyyy-mm-dd"
|
format: "yyyy-mm-dd",
|
||||||
|
todayHighlight: true
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -2,12 +2,6 @@
|
|||||||
<td>
|
<td>
|
||||||
<%= task_request.id %>
|
<%= task_request.id %>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
|
||||||
<%= task_request.project.account.name %>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<%= task_request.project.name %>
|
|
||||||
</td>
|
|
||||||
<td>
|
<td>
|
||||||
<%= task_request.created_at.strftime("%D") %>
|
<%= task_request.created_at.strftime("%D") %>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@@ -3,8 +3,6 @@
|
|||||||
<thead class="thead-light">
|
<thead class="thead-light">
|
||||||
<tr>
|
<tr>
|
||||||
<th>Task ID</th>
|
<th>Task ID</th>
|
||||||
<th>Account Name</th>
|
|
||||||
<th>Project Name</th>
|
|
||||||
<th>Created On</th>
|
<th>Created On</th>
|
||||||
<th>Deadline</th>
|
<th>Deadline</th>
|
||||||
<th>Time Allowed</th>
|
<th>Time Allowed</th>
|
||||||
@@ -17,7 +15,7 @@
|
|||||||
<%= render @task_requests %>
|
<%= render @task_requests %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="20" class="py-4 text-center text-muted"><%= t(".empty") %></td>
|
<td colspan="6" class="py-4 text-center text-muted"><%= t(".empty") %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@@ -1,48 +0,0 @@
|
|||||||
require "rails_helper"
|
|
||||||
|
|
||||||
feature "Admin managing task requests" do
|
|
||||||
let(:current_user) { create(:user, admin: true, email: "user@test.com") }
|
|
||||||
let(:project) { create(:project, account: current_user.primary_account, name: "Test Project") }
|
|
||||||
|
|
||||||
before do
|
|
||||||
sign_in current_user
|
|
||||||
end
|
|
||||||
|
|
||||||
scenario "task requests table is visible" do
|
|
||||||
visit admin_task_requests_path
|
|
||||||
|
|
||||||
expect(page).to have_content "Task ID"
|
|
||||||
expect(page).to have_content "Account Name"
|
|
||||||
expect(page).to have_content "Project Name"
|
|
||||||
expect(page).to have_content "Created On"
|
|
||||||
expect(page).to have_content "Deadline"
|
|
||||||
expect(page).to have_content "Time Allowed"
|
|
||||||
expect(page).to have_content "Status"
|
|
||||||
end
|
|
||||||
|
|
||||||
scenario "sees list of task requests" do
|
|
||||||
visit admin_task_requests_path
|
|
||||||
|
|
||||||
expect(page).to have_content no_task_requests_label
|
|
||||||
|
|
||||||
task_request = create(:task_request)
|
|
||||||
|
|
||||||
visit admin_task_requests_path
|
|
||||||
|
|
||||||
expect(page).not_to have_content no_task_requests_label
|
|
||||||
|
|
||||||
expect(page).to have_content task_request.id
|
|
||||||
expect(page).to have_content task_request.project.account.name
|
|
||||||
expect(page).to have_content task_request.project.name
|
|
||||||
expect(page).to have_content task_request.created_at.try(:strftime, '%D')
|
|
||||||
expect(page).to have_content task_request.deadline.try(:strftime, '%D')
|
|
||||||
expect(page).to have_content task_request.time_allowed
|
|
||||||
expect(page).to have_content task_request.status.capitalize
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def no_task_requests_label
|
|
||||||
"Task requests will appear here"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
Reference in New Issue
Block a user