Skip to content

Commit

Permalink
Fix specs.
Browse files Browse the repository at this point in the history
  • Loading branch information
taitus committed Dec 7, 2017
1 parent a2c0c4f commit c4b7edd
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion app/views/events/show.html.erb
Expand Up @@ -7,7 +7,7 @@
<p><strong><%= t('backend.title') %>:</strong> <%= @event.title %></p>
<p><strong><%= t('backend.location') %>:</strong> <%= @event.location %></p>
<p><strong><%= t('backend.date') %>:</strong> <%= @event.scheduled.strftime(t('time.formats.short')) %></p>
<p><strong><%= t('backend.description') %>:</strong><%= @event.description.html_safe %></p>
<p><strong><%= t('backend.description') %>:</strong><%= @event.description.html_safe if @event.description.present? %></p>
</fieldset>
<% if @event.user.present? %>
<fieldset>
Expand Down
2 changes: 1 addition & 1 deletion app/views/organizations/show.html.erb
Expand Up @@ -16,7 +16,7 @@
<p><strong><%= t('organizations.show.address') %>: </strong><%= @organization.address %></p>
<p><strong><%= t('organizations.show.province') %>: </strong><%= @organization.province %></p>
<p><strong><%= t('organizations.show.category') %>: </strong><%= @organization.category.name %></p>
<p><strong><%= t('organizations.show.description') %>: </strong><%= @organization.description.html_safe %></p>
<p><strong><%= t('organizations.show.description') %>: </strong><%= @organization.description.html_safe if @organization.description.present? %></p>
<p><strong><%= t('organizations.show.web') %>: </strong> <%= @organization.web %></p>
</fieldset>

Expand Down
2 changes: 1 addition & 1 deletion app/views/visitors/show.html.erb
Expand Up @@ -72,7 +72,7 @@
<strong class="post__subtitle"><%= t('show.description')%></strong>
</div>
<div class="small-12 large-7 end columns">
<p class="post__text"><%= @event.description.html_safe%></p>
<p class="post__text"><%= @event.description.html_safe if @event.description.present? %></p>
</div>
</div>

Expand Down
44 changes: 22 additions & 22 deletions spec/features/admin/events_spec.rb
Expand Up @@ -324,8 +324,8 @@
choose_autocomplete :event_organization_name, with: organization.name, select: organization.name

expect(page).to have_selector("#category-block", visible: true)
expect(page).to have_selector("#re-block", visible: true)
expect(page).to have_selector("#agents-block", visible: true)
expect(page).to have_selector(".represented-entities-block", visible: true)
expect(page).to have_selector(".agents-block", visible: true)
end

scenario 'We can search organization by identifier', :js do
Expand All @@ -336,8 +336,8 @@
choose_autocomplete :event_organization_name, with: "43138883z", select: organization.name

expect(page).to have_selector("#category-block", visible: true)
expect(page).to have_selector("#re-block", visible: true)
expect(page).to have_selector("#agents-block", visible: true)
expect(page).to have_selector(".represented-entities-block", visible: true)
expect(page).to have_selector(".agents-block", visible: true)
end

scenario 'When select organization display category', :js do
Expand All @@ -361,7 +361,7 @@

choose_autocomplete :event_organization_name, with: organization.name, select: organization.name

within "#re-block" do
within ".represented-entities-block" do
expect(page).to have_selector("option[value='#{organization.name}']")
end
end
Expand All @@ -374,7 +374,7 @@

choose_autocomplete :event_organization_name, with: organization.name, select: organization.name

within "#re-block" do
within ".represented-entities-block" do
expect(page).to have_selector("option[value='#{represented_entity.name}']")
end
end
Expand All @@ -390,7 +390,7 @@

choose_autocomplete :event_organization_name, with: organization.name, select: organization.name

within "#agents-block" do
within ".agents-block" do
expect(page).to have_selector("option[value='No hay agentes disponibles.']")
end
end
Expand All @@ -403,7 +403,7 @@

choose_autocomplete :event_organization_name, with: organization.name, select: organization.name

within "#agents-block" do
within ".agents-block" do
expect(page).to have_selector("option[value='#{agent.name}']")
end
end
Expand Down Expand Up @@ -515,8 +515,8 @@
visit new_event_path

expect(page).to have_selector("#category-block", visible: true)
expect(page).to have_selector("#re-block", visible: true)
expect(page).to have_selector("#agents-block", visible: true)
expect(page).to have_selector(".represented-entities-block", visible: true)
expect(page).to have_selector(".agents-block", visible: true)
end

scenario 'When fill by js organization_name display category', :js do
Expand All @@ -532,11 +532,11 @@
scenario 'When fill by js organization_name without represented_entity display organization on represented_entity selector', :js do
visit new_event_path

within "#re-block" do
find("#link_to_add_association_re").click
within ".represented-entities-block" do
find("#event_represented_entities_link").click
end

within "#re-block" do
within ".represented-entities-block" do
expect(page).to have_selector("option[value='#{@organization.name}']")
end
end
Expand All @@ -545,11 +545,11 @@
represented_entity = create(:represented_entity, organization: @organization)
visit new_event_path

within "#re-block" do
find("#link_to_add_association_re").click
within ".represented-entities-block" do
find("#event_represented_entities_link").click
end

within "#re-block" do
within ".represented-entities-block" do
expect(page).to have_selector("option[value='#{represented_entity.name}']")
end
end
Expand All @@ -561,11 +561,11 @@
scenario 'When fill by js organization_name without agents display no_result_text on agents selector', :js do
visit new_event_path

within "#agents-block" do
find("#link_to_add_association_agent").click
within ".agents-block" do
find("#event_agents_link").click
end

within "#agents-block" do
within ".agents-block" do
expect(page).to have_selector("option[value='No hay agentes disponibles.']")
end
end
Expand All @@ -574,11 +574,11 @@
agent = create(:agent, organization: @organization)
visit new_event_path

within "#agents-block" do
find("#link_to_add_association_agent").click
within ".agents-block" do
find("#event_agents_link").click
end

within "#agents-block" do
within ".agents-block" do
expect(page).to have_selector("option[value='#{agent.name}']")
end
end
Expand Down

0 comments on commit c4b7edd

Please sign in to comment.