'Add to valuators' option added to Valuators search view
This commit is contained in:
@@ -1,28 +0,0 @@
|
|||||||
<div class="small-12 column">
|
|
||||||
<h3><%= t('admin.valuators.valuator.user_found') %></h3>
|
|
||||||
|
|
||||||
<table>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<%= valuator.name %>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<%= valuator.email %>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<% unless @valuator.persisted? %>
|
|
||||||
<%= form_for @valuator, url: admin_valuators_path do |f| %>
|
|
||||||
<div class="row">
|
|
||||||
<div class="small-12 medium-4 column ">
|
|
||||||
<%= f.text_field :description, label: false, placeholder: t('admin.valuators.valuator.description_placeholder') %>
|
|
||||||
<%= f.hidden_field :user_id %>
|
|
||||||
</div>
|
|
||||||
<div class="small-12 medium-2 column end" style="border:ddotted 10px red;">
|
|
||||||
<%= f.submit t('admin.valuators.valuator.add'), class: "button success float-left" %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
@@ -9,9 +9,17 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td><%= user.name %></td>
|
<td><%= user.name %></td>
|
||||||
<td><%= user.email %></td>
|
<td><%= user.email %></td>
|
||||||
<td>
|
<td class="float-right">
|
||||||
<% if user.valuator? && user.valuator.description.present? %>
|
<% if user.valuator? && user.valuator.description.present? %>
|
||||||
<%= user.valuator.description %>
|
<%= user.valuator.description %>
|
||||||
|
<% else %>
|
||||||
|
<%= form_for Valuator.new(user: user), url: admin_valuators_path do |f| %>
|
||||||
|
<%= f.text_field :description,
|
||||||
|
label: false,
|
||||||
|
placeholder: t("admin.valuators.valuator.description_placeholder") %>
|
||||||
|
<%= f.hidden_field :user_id %>
|
||||||
|
<%= f.submit t("admin.valuators.valuator.add"), class: "button success float-left" %>
|
||||||
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -454,7 +454,6 @@ en:
|
|||||||
title: Valuators
|
title: Valuators
|
||||||
valuator:
|
valuator:
|
||||||
description_placeholder: 'Description (optional)'
|
description_placeholder: 'Description (optional)'
|
||||||
user_found: User found
|
|
||||||
add: Add to valuators
|
add: Add to valuators
|
||||||
search:
|
search:
|
||||||
title: 'Valuators: User search'
|
title: 'Valuators: User search'
|
||||||
|
|||||||
@@ -454,7 +454,6 @@ es:
|
|||||||
title: Evaluadores
|
title: Evaluadores
|
||||||
valuator:
|
valuator:
|
||||||
description_placeholder: "Descripción (opcional)"
|
description_placeholder: "Descripción (opcional)"
|
||||||
user_found: Usuario encontrado
|
|
||||||
add: Añadir como evaluador
|
add: Añadir como evaluador
|
||||||
search:
|
search:
|
||||||
title: 'Evaluadores: Búsqueda de usuarios'
|
title: 'Evaluadores: Búsqueda de usuarios'
|
||||||
|
|||||||
@@ -10,22 +10,22 @@ feature 'Admin valuators' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
scenario 'Index' do
|
scenario 'Index' do
|
||||||
expect(page).to have_content @valuator.name
|
expect(page).to have_content(@valuator.name)
|
||||||
expect(page).to have_content @valuator.email
|
expect(page).to have_content(@valuator.email)
|
||||||
expect(page).to_not have_content @user.name
|
expect(page).to_not have_content(@user.name)
|
||||||
end
|
end
|
||||||
|
|
||||||
pending 'Create Valuator', :js do
|
scenario 'Create Valuator', :js do
|
||||||
fill_in 'name_or_email', with: @user.email
|
fill_in 'name_or_email', with: @user.email
|
||||||
click_button 'Search'
|
click_button 'Search'
|
||||||
|
|
||||||
expect(page).to have_content @user.name
|
expect(page).to have_content(@user.name)
|
||||||
fill_in 'valuator_description', with: 'environmental expert'
|
fill_in 'valuator_description', with: 'environmental expert'
|
||||||
click_button 'Add to valuators'
|
click_button 'Add to valuators'
|
||||||
|
|
||||||
within("#valuators") do
|
within('#valuators') do
|
||||||
expect(page).to have_content @user.name
|
expect(page).to have_content(@user.name)
|
||||||
expect(page).to have_content 'environmental expert'
|
expect(page).to have_content('environmental expert')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user