adds pending specs

This commit is contained in:
rgarcia
2016-12-20 12:21:45 +01:00
parent 398206c375
commit 76723070e2
4 changed files with 119 additions and 0 deletions

View File

@@ -343,4 +343,12 @@ FactoryGirl.define do
association :sender, factory: :user
association :receiver, factory: :user
end
factory :signature_sheet do
end
factory :signature do
end
end

View File

@@ -0,0 +1,35 @@
feature 'Signature sheets' do
background do
admin = create(:administrator)
login_as(admin.user)
end
scenario "Index"
scenario 'Create' do
visit admin_path
click_link 'Signature Sheets'
click_link 'New'
select "Proposal", from: "signable_type"
fill_in "signable_id", with: "1"
fill_in "document_numbers", with: "12345678Z, 99999999Z"
click_button "Save"
expect(page).to have_content "Signature sheet saved successfully"
end
scenario 'Errors on create'
scenario 'Show' do
#display signable
#display created_at
#display author
#display valid signatures count
#display invalid signatures count
#display invalid signatures with their error
end
end

View File

@@ -0,0 +1,30 @@
require 'rails_helper'
describe SignatureSheet do
describe "validations" do
it "should be valid"
it "should not be valid without a valid signable"
it "should not be valid without document numbers"
it "should not be valid without an author"
end
describe "name" do
it "returns name for proposal signature sheets"
it "returns name for spending proposal signature sheets"
end
describe "verify_signatures" do
it "marks signature sheet as processed after verifing all document numbers"
end
describe "invalid_signatures" do
it "returns invalid signatures"
it "does not return valid signatures"
end
describe "parsed_document_numbers" do
it "returns an array after spliting document numbers by newlines"
end
end

View File

@@ -0,0 +1,46 @@
require 'rails_helper'
describe Signature
describe "validations" do
it "should be valid"
it "should be valid if user exists"
it "should not be valid if already voted"
it "should not be valid if not in census"
end
describe "in census" do
it "checks for all document_types"
end
describe "verify" do
describie "valid" do
it "sets status to verified"
it "asigns vote to user"
end
describe "invalid"
it "sets status to error"
it "does not asign any votes"
end
end
describe "assign vote" do
describe "existing user" do
it "assigns vote to user"
it "does not assign vote to user if already voted"
it "marks the vote as coming from a signature"
end
describe "inexistent user" do
it "creates a user with that document number"
it "assign the vote to newly created user"
it "marks the vote as coming from a signature"
end
end
end