Use describe on new feature tests
The `type: :feature` is automatically detected by RSpec because these tests are inside the `spec/features` folder. Using `feature` re-adds a `type: :feature` to these files, which will result in a conflict when we upgrade to Rails 5.1's system tests. Because of this change, we also need to change `background` to `before` or else these tests will fail. We're also adding a rubocop rule so we dont' accidentally add these keywords again.
This commit is contained in:
@@ -14,6 +14,12 @@ AllCops:
|
|||||||
# to ignore them, so only the ones explicitly set in this file are enabled.
|
# to ignore them, so only the ones explicitly set in this file are enabled.
|
||||||
DisabledByDefault: true
|
DisabledByDefault: true
|
||||||
|
|
||||||
|
Capybara/FeatureMethods:
|
||||||
|
Enabled: true
|
||||||
|
EnabledMethods:
|
||||||
|
- scenario
|
||||||
|
- xscenario
|
||||||
|
|
||||||
Layout/IndentationConsistency:
|
Layout/IndentationConsistency:
|
||||||
EnforcedStyle: rails
|
EnforcedStyle: rails
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
require "rails_helper"
|
require "rails_helper"
|
||||||
|
|
||||||
feature "Admin change log" do
|
describe "Admin change log" do
|
||||||
let(:budget) {create(:budget)}
|
let(:budget) {create(:budget)}
|
||||||
let(:administrator) do
|
let(:administrator) do
|
||||||
create(:administrator, user: create(:user, username: "Ana", email: "ana@admins.org"))
|
create(:administrator, user: create(:user, username: "Ana", email: "ana@admins.org"))
|
||||||
@@ -8,7 +8,7 @@ feature "Admin change log" do
|
|||||||
|
|
||||||
context "Investments Participatory Budgets" do
|
context "Investments Participatory Budgets" do
|
||||||
|
|
||||||
background do
|
before do
|
||||||
@admin = create(:administrator)
|
@admin = create(:administrator)
|
||||||
login_as(@admin.user)
|
login_as(@admin.user)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
require "rails_helper"
|
require "rails_helper"
|
||||||
|
|
||||||
feature "Admin download settings" do
|
describe "Admin download settings" do
|
||||||
|
|
||||||
background do
|
before do
|
||||||
admin = create(:administrator)
|
admin = create(:administrator)
|
||||||
login_as(admin.user)
|
login_as(admin.user)
|
||||||
end
|
end
|
||||||
@@ -31,7 +31,7 @@ feature "Admin download settings" do
|
|||||||
|
|
||||||
context "Download debates" do
|
context "Download debates" do
|
||||||
|
|
||||||
background do
|
before do
|
||||||
create(:debate)
|
create(:debate)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -84,7 +84,7 @@ feature "Admin download settings" do
|
|||||||
|
|
||||||
context "Download proposals" do
|
context "Download proposals" do
|
||||||
|
|
||||||
background do
|
before do
|
||||||
create(:proposal)
|
create(:proposal)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -177,7 +177,7 @@ feature "Admin download settings" do
|
|||||||
|
|
||||||
context "Download legislation process" do
|
context "Download legislation process" do
|
||||||
|
|
||||||
background do
|
before do
|
||||||
create(:legislation_process, :open)
|
create(:legislation_process, :open)
|
||||||
create(:legislation_process, :published)
|
create(:legislation_process, :published)
|
||||||
end
|
end
|
||||||
@@ -286,7 +286,7 @@ feature "Admin download settings" do
|
|||||||
ballot_lines_count: 600) }
|
ballot_lines_count: 600) }
|
||||||
let(:budget) {create :budget}
|
let(:budget) {create :budget}
|
||||||
|
|
||||||
background do
|
before do
|
||||||
Budget::Result.new(budget_finished, heading).calculate_winners
|
Budget::Result.new(budget_finished, heading).calculate_winners
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
require "rails_helper"
|
require "rails_helper"
|
||||||
|
|
||||||
feature "Imports", type: :feature do
|
describe "Imports" do
|
||||||
|
|
||||||
let(:base_files_path) { %w[spec fixtures files local_census_records import] }
|
let(:base_files_path) { %w[spec fixtures files local_census_records import] }
|
||||||
|
|
||||||
background do
|
before do
|
||||||
admin = create(:administrator)
|
admin = create(:administrator)
|
||||||
login_as(admin.user)
|
login_as(admin.user)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
require "rails_helper"
|
require "rails_helper"
|
||||||
|
|
||||||
feature "Admin local census records" do
|
describe "Admin local census records" do
|
||||||
|
|
||||||
background do
|
before do
|
||||||
login_as(create(:administrator).user)
|
login_as(create(:administrator).user)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ feature "Admin local census records" do
|
|||||||
end
|
end
|
||||||
|
|
||||||
context "Search" do
|
context "Search" do
|
||||||
background do
|
before do
|
||||||
create(:local_census_record, document_number: "X66777888" )
|
create(:local_census_record, document_number: "X66777888" )
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
require "rails_helper"
|
require "rails_helper"
|
||||||
|
|
||||||
feature "Legislation" do
|
describe "Legislation" do
|
||||||
context "process resume page" do
|
context "process resume page" do
|
||||||
|
|
||||||
scenario "resume tab not show" do
|
scenario "resume tab not show" do
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
require "rails_helper"
|
require "rails_helper"
|
||||||
|
|
||||||
feature "Poll Votation Type" do
|
describe "Poll Votation Type" do
|
||||||
|
|
||||||
context "Unique" do
|
context "Unique" do
|
||||||
|
|
||||||
@@ -10,7 +10,7 @@ feature "Poll Votation Type" do
|
|||||||
let!(:answer1) { create(:poll_question_answer, question: unique, title: "answer_1") }
|
let!(:answer1) { create(:poll_question_answer, question: unique, title: "answer_1") }
|
||||||
let!(:answer2) { create(:poll_question_answer, question: unique, title: "answer_2") }
|
let!(:answer2) { create(:poll_question_answer, question: unique, title: "answer_2") }
|
||||||
|
|
||||||
background do
|
before do
|
||||||
login_as(user)
|
login_as(user)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ feature "Poll Votation Type" do
|
|||||||
let!(:answer4) { create(:poll_question_answer, question: question, title: "answer_4") }
|
let!(:answer4) { create(:poll_question_answer, question: question, title: "answer_4") }
|
||||||
let!(:answer5) { create(:poll_question_answer, question: question, title: "answer_5") }
|
let!(:answer5) { create(:poll_question_answer, question: question, title: "answer_5") }
|
||||||
|
|
||||||
background do
|
before do
|
||||||
login_as(user)
|
login_as(user)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -148,7 +148,7 @@ feature "Poll Votation Type" do
|
|||||||
let!(:answer4) { create(:poll_question_answer, question: question, title: "answer_4") }
|
let!(:answer4) { create(:poll_question_answer, question: question, title: "answer_4") }
|
||||||
let!(:answer5) { create(:poll_question_answer, question: question, title: "answer_5") }
|
let!(:answer5) { create(:poll_question_answer, question: question, title: "answer_5") }
|
||||||
|
|
||||||
background do
|
before do
|
||||||
login_as(user)
|
login_as(user)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -210,7 +210,7 @@ feature "Poll Votation Type" do
|
|||||||
let!(:answer4) { create(:poll_question_answer, question: question, title: "answer_4") }
|
let!(:answer4) { create(:poll_question_answer, question: question, title: "answer_4") }
|
||||||
let!(:answer5) { create(:poll_question_answer, question: question, title: "answer_5") }
|
let!(:answer5) { create(:poll_question_answer, question: question, title: "answer_5") }
|
||||||
|
|
||||||
background do
|
before do
|
||||||
login_as(user)
|
login_as(user)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -306,7 +306,7 @@ feature "Poll Votation Type" do
|
|||||||
let!(:answer4) { create(:poll_question_answer, question: question, title: "answer_4") }
|
let!(:answer4) { create(:poll_question_answer, question: question, title: "answer_4") }
|
||||||
let!(:answer5) { create(:poll_question_answer, question: question, title: "answer_5") }
|
let!(:answer5) { create(:poll_question_answer, question: question, title: "answer_5") }
|
||||||
|
|
||||||
background do
|
before do
|
||||||
login_as(user)
|
login_as(user)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
require "rails_helper"
|
require "rails_helper"
|
||||||
|
|
||||||
feature "Valuation budget investments" do
|
describe "Valuation budget investments" do
|
||||||
|
|
||||||
let(:budget) { create(:budget) }
|
let(:budget) { create(:budget) }
|
||||||
let(:tracker) do
|
let(:tracker) do
|
||||||
create(:tracker, user: create(:user, username: "Rachel", email: "rachel@trackers.org"))
|
create(:tracker, user: create(:user, username: "Rachel", email: "rachel@trackers.org"))
|
||||||
end
|
end
|
||||||
|
|
||||||
background do
|
before do
|
||||||
login_as(tracker.user)
|
login_as(tracker.user)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -23,7 +23,7 @@ feature "Valuation budget investments" do
|
|||||||
expect(page).to have_link "Tracking", href: tracking_root_path
|
expect(page).to have_link "Tracking", href: tracking_root_path
|
||||||
end
|
end
|
||||||
|
|
||||||
feature "Index" do
|
describe "Index" do
|
||||||
scenario "Index shows budget investments assigned to current tracker" do
|
scenario "Index shows budget investments assigned to current tracker" do
|
||||||
investment1 = create(:budget_investment, budget: budget)
|
investment1 = create(:budget_investment, budget: budget)
|
||||||
investment2 = create(:budget_investment, budget: budget)
|
investment2 = create(:budget_investment, budget: budget)
|
||||||
@@ -108,7 +108,7 @@ feature "Valuation budget investments" do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
feature "Show" do
|
describe "Show" do
|
||||||
let(:administrator) do
|
let(:administrator) do
|
||||||
create(:administrator, user: create(:user, username: "Ana", email: "ana@admins.org"))
|
create(:administrator, user: create(:user, username: "Ana", email: "ana@admins.org"))
|
||||||
end
|
end
|
||||||
@@ -119,7 +119,7 @@ feature "Valuation budget investments" do
|
|||||||
create(:budget_investment, budget: budget, administrator: administrator)
|
create(:budget_investment, budget: budget, administrator: administrator)
|
||||||
end
|
end
|
||||||
|
|
||||||
background do
|
before do
|
||||||
investment.trackers << [tracker, second_tracker]
|
investment.trackers << [tracker, second_tracker]
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -168,7 +168,7 @@ feature "Valuation budget investments" do
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
feature "Milestones" do
|
describe "Milestones" do
|
||||||
let(:admin) { create(:administrator) }
|
let(:admin) { create(:administrator) }
|
||||||
let(:investment) do
|
let(:investment) do
|
||||||
heading = create(:budget_heading)
|
heading = create(:budget_heading)
|
||||||
@@ -176,7 +176,7 @@ feature "Valuation budget investments" do
|
|||||||
administrator: admin)
|
administrator: admin)
|
||||||
end
|
end
|
||||||
|
|
||||||
background do
|
before do
|
||||||
investment.trackers << tracker
|
investment.trackers << tracker
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -250,7 +250,7 @@ feature "Valuation budget investments" do
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
feature "Progress Bars" do
|
describe "Progress Bars" do
|
||||||
|
|
||||||
let(:admin) { create(:administrator) }
|
let(:admin) { create(:administrator) }
|
||||||
let(:investment) do
|
let(:investment) do
|
||||||
@@ -259,7 +259,7 @@ feature "Valuation budget investments" do
|
|||||||
administrator: admin)
|
administrator: admin)
|
||||||
end
|
end
|
||||||
|
|
||||||
background do
|
before do
|
||||||
investment.trackers << tracker
|
investment.trackers << tracker
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
require "rails_helper"
|
require "rails_helper"
|
||||||
|
|
||||||
feature "Tracking budgets" do
|
describe "Tracking budgets" do
|
||||||
|
|
||||||
background do
|
before do
|
||||||
@tracker = create(:tracker, user: create(:user, username: "Rachel",
|
@tracker = create(:tracker, user: create(:user, username: "Rachel",
|
||||||
email: "rachel@trackers.org"))
|
email: "rachel@trackers.org"))
|
||||||
login_as(@tracker.user)
|
login_as(@tracker.user)
|
||||||
|
|||||||
Reference in New Issue
Block a user