Fixes specs

This commit is contained in:
Alberto Garcia Cabeza
2016-06-01 21:46:17 +02:00
parent 9e31eeefad
commit 31cb29d8c5
6 changed files with 18 additions and 12 deletions

View File

@@ -35,7 +35,7 @@
<button type="button" class="button hollow expanded" data-toggle="offCanvas"><%= t("admin.menu.admin") %></button> <button type="button" class="button hollow expanded" data-toggle="offCanvas"><%= t("admin.menu.admin") %></button>
</div> </div>
<div class="hide-for-small-only"> <div id="side_menu" class="hide-for-small-only">
<%= side_menu %> <%= side_menu %>
</div> </div>
</div> </div>

View File

@@ -15,7 +15,7 @@
<h3><%= page_entries_info @users %></h3> <h3><%= page_entries_info @users %></h3>
<% end %> <% end %>
<table> <table id="moderation_users">
<tbody> <tbody>
<% @users.each do |user| %> <% @users.each do |user| %>
<tr> <tr>

View File

@@ -220,7 +220,7 @@ feature 'Admin activity' do
visit moderation_users_path(name_or_email: user.username) visit moderation_users_path(name_or_email: user.username)
within(".admin-list") do within("#moderation_users") do
click_link 'Block' click_link 'Block'
end end

View File

@@ -67,14 +67,17 @@ feature 'Admin banners magement' do
scenario 'Banners publication is listed on admin menu' do scenario 'Banners publication is listed on admin menu' do
visit admin_root_path visit admin_root_path
within('#admin_menu') do within('#side_menu') do
expect(page).to have_link "Manage banners" expect(page).to have_link "Manage banners"
end end
end end
scenario 'Publish a banner' do scenario 'Publish a banner' do
visit admin_root_path visit admin_root_path
within('#side_menu') do
click_link "Manage banners" click_link "Manage banners"
end
click_link "Create banner" click_link "Create banner"
@@ -108,7 +111,10 @@ feature 'Admin banners magement' do
post_ended_at: (Time.now + 10.days)) post_ended_at: (Time.now + 10.days))
visit admin_root_path visit admin_root_path
within('#side_menu') do
click_link "Manage banners" click_link "Manage banners"
end
click_link "Edit banner" click_link "Edit banner"

View File

@@ -9,7 +9,7 @@ feature 'Admin feature flags' do
scenario 'Enabled features are listed on menu' do scenario 'Enabled features are listed on menu' do
visit admin_root_path visit admin_root_path
within('#admin_menu') do within('#side_menu') do
expect(page).to have_link "Spending proposals" expect(page).to have_link "Spending proposals"
expect(page).to have_link "Hidden debates" expect(page).to have_link "Hidden debates"
end end
@@ -28,7 +28,7 @@ feature 'Admin feature flags' do
visit admin_root_path visit admin_root_path
within('#admin_menu') do within('#side_menu') do
expect(page).not_to have_link "Spending proposals" expect(page).not_to have_link "Spending proposals"
end end
@@ -42,7 +42,7 @@ feature 'Admin feature flags' do
visit admin_root_path visit admin_root_path
within('#admin_menu') do within('#side_menu') do
expect(page).not_to have_link "Spending proposals" expect(page).not_to have_link "Spending proposals"
end end
@@ -56,7 +56,7 @@ feature 'Admin feature flags' do
visit admin_root_path visit admin_root_path
within('#admin_menu') do within('#side_menu') do
expect(page).to have_link "Spending proposals" expect(page).to have_link "Spending proposals"
end end
end end

View File

@@ -62,13 +62,13 @@ feature 'Moderate users' do
fill_in 'name_or_email', with: 'Wanda' fill_in 'name_or_email', with: 'Wanda'
click_button 'Search' click_button 'Search'
within(".admin-list") do within("#moderation_users") do
expect(page).to have_content citizen.name expect(page).to have_content citizen.name
expect(page).not_to have_content "Blocked" expect(page).not_to have_content "Blocked"
click_link 'Block' click_link 'Block'
end end
within(".admin-list") do within("#moderation_users") do
expect(page).to have_content citizen.name expect(page).to have_content citizen.name
expect(page).to have_content "Blocked" expect(page).to have_content "Blocked"
end end