Task me upstream sync

This commit is contained in:
Senad Uka
2020-06-25 08:47:10 +02:00
parent c167889ea3
commit 749aad3467
5 changed files with 13 additions and 3 deletions

View File

@@ -5,4 +5,6 @@ class TaskRequest < ApplicationRecord
enum status: [:pending, :completed, :cancelled]
scope :order_by_recent, -> { order(created_at: :desc) }
validates :time_allowed, numericality: { only_integer: true, greater_than_or_equal_to: 2 }
end

View File

@@ -1,7 +1,7 @@
<%= errors_summary_for task_request %>
<%= bootstrap_form_with model: model, url: [@project, @task_request, show_chat: true], local: true do |form| %>
<div class="alert alert-notice text-center pl-0 text-md-left mt-4">
<div class="alert alert-info text-center text-md-left">
<%= fa_icon "info-circle" %>
<strong><%= t '.info_message' %></strong>
</div>

View File

@@ -2,7 +2,11 @@
<%= javascript_include_tag "https://js.hs-scripts.com/7344617.js", defer: "defer", async: true, id: "hs-script-loader" %>
<%= javascript_tag nonce: true do %>
$(document).ready(function(){
window.HubSpotConversations.widget.open();
window.hsConversationsOnReady = [
function() {
window.HubSpotConversations.widget.open();
}
]
});
<% end %>
<% end %>

View File

@@ -3,7 +3,7 @@ FactoryBot.define do
association :project
user_email 'test@email.com'
deadline { 10.days.from_now }
time_allowed "10 days"
time_allowed 5
description "Task request"
additional_notes "Additional notes"
status 0

View File

@@ -13,4 +13,8 @@ RSpec.describe TaskRequest, type: :model do
subject { described_class }
it { is_expected.to respond_to(:order_by_recent) }
end
describe "#validations" do
it { should validate_numericality_of(:time_allowed).only_integer.is_greater_than_or_equal_to(2) }
end
end