bb2b38cd44b032118359afbc743efbea12f48e61bnicholesrequire 'spec_helper'
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesdescribe Theorem do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes context 'Associations' do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes it { should have_many(:proof_attempts) }
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes it { should belong_to(:proof_status) }
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes context 'Theorem of an ontology' do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes let(:theorem) { create :theorem }
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes context 'prove_options' do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes let(:ontology) { theorem.ontology }
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes let(:repository) { ontology.repository }
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes let(:prove_options) { theorem.prove_options }
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes it 'have the ontology name as node parameter' do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes expect(prove_options.options[:node]).to eq(ontology.name)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes it 'have the theorem name as theorems parameter' do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes expect(prove_options.options[:theorems]).to eq([theorem.name])
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes context 'on a private repository' do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes before do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes repository.access = 'private_rw'
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes repository.save!
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes it 'have an existing access-token parameter' do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes expect(prove_options.options[:'access-token']).to be_present
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes it 'have the access token as access-token parameter' do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes expect(prove_options.options[:'access-token']).
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes to eq(repository.access_tokens.first.to_s)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes context 'with url-maps' do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes let!(:url_maps) { [create(:url_map, repository: repository)] }
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes it 'have the url-maps as url-catalog parameter' do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes expect(prove_options.options[:'url-catalog']).to eq(url_maps.join(','))
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes context 'without url-maps' do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes it 'have no url-catalog parameter' do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes expect(prove_options.options[:'url-catalog']).to be(nil)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes context 'update_proof_status!' do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes let(:open) { create :proof_status_open }
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes let(:success) { create :proof_status_success }
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes let(:unknown) { create :proof_status_unknown }
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes let(:disproven_on_subset) { create :proof_status_csas }
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes let(:disproven) { create :proof_status_csa }
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes let(:proven) { create :proof_status_proven }
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes let(:contr) { create :proof_status_contr}
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes context 'from status open' do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes let(:theorem) do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes proof_attempt = create :proof_attempt, proof_status: open
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes proof_attempt.theorem
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes %i(open unknown success disproven_on_subset disproven proven contr).each do |status|
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes context "to status #{status}" do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes before { create :proof_attempt, theorem: theorem, proof_status: send(status) }
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes it "theorem has status #{status}" do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes expect(theorem.proof_status).to eq(send(status))
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes context 'from status unknown' do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes let(:theorem) do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes proof_attempt = create :proof_attempt, proof_status: unknown
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes proof_attempt.theorem
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes %i(open).each do |status|
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes context "to status #{status}" do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes before { create :proof_attempt, theorem: theorem, proof_status: send(status) }
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes it "theorem has status unknown" do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes expect(theorem.proof_status).to eq(unknown)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes %i(success disproven_on_subset disproven proven contr).each do |status|
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes context "to status #{status}" do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes before { create :proof_attempt, theorem: theorem, proof_status: send(status) }
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes it "theorem has status #{status}" do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes expect(theorem.proof_status).to eq(send(status))
0a39e7683f6611d66c55712f50bb240428d832a1bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes context 'from status success' do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes let(:theorem) do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes proof_attempt = create :proof_attempt, proof_status: success
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes proof_attempt.theorem
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes %i(open unknown).each do |status|
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes context "to status #{status}" do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes before { create :proof_attempt, theorem: theorem, proof_status: send(status) }
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes it "theorem has status success" do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes expect(theorem.proof_status).to eq(success)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes %i(success disproven_on_subset disproven proven contr).each do |status|
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes context "to status #{status}" do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes before { create :proof_attempt, theorem: theorem, proof_status: send(status) }
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes it "theorem has status #{status}" do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes expect(theorem.proof_status).to eq(send(status))
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes context 'from status disproven_on_subset' do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes let(:theorem) do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes proof_attempt = create :proof_attempt, proof_status: disproven_on_subset
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes proof_attempt.theorem
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes %i(open unknown success).each do |status|
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes context "to status #{status}" do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes before { create :proof_attempt, theorem: theorem, proof_status: send(status) }
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes it "theorem has status unknown" do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes expect(theorem.proof_status).to eq(disproven_on_subset)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes %i(disproven_on_subset disproven proven contr).each do |status|
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes context "to status #{status}" do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes before { create :proof_attempt, theorem: theorem, proof_status: send(status) }
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes it "theorem has status #{status}" do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes expect(theorem.proof_status).to eq(send(status))
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes context 'from status disproven' do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes let(:theorem) do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes proof_attempt = create :proof_attempt, proof_status: disproven
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes proof_attempt.theorem
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes %i(open unknown success disproven_on_subset).each do |status|
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes context "to status #{status}" do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes before { create :proof_attempt, theorem: theorem, proof_status: send(status) }
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes it "theorem has status unknown" do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes expect(theorem.proof_status).to eq(disproven)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes %i(disproven contr).each do |status|
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes context "to status #{status}" do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes before { create :proof_attempt, theorem: theorem, proof_status: send(status) }
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes it "theorem has status #{status}" do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes expect(theorem.proof_status).to eq(send(status))
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes context 'from status proven' do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes let(:theorem) do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes proof_attempt = create :proof_attempt, proof_status: proven
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes proof_attempt.theorem
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes %i(open unknown success disproven_on_subset).each do |status|
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes context "to status #{status}" do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes before { create :proof_attempt, theorem: theorem, proof_status: send(status) }
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes it "theorem has status unknown" do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes expect(theorem.proof_status).to eq(proven)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes %i(proven contr).each do |status|
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes context "to status #{status}" do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes before { create :proof_attempt, theorem: theorem, proof_status: send(status) }
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes it "theorem has status #{status}" do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes expect(theorem.proof_status).to eq(send(status))
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes context 'from status contr' do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes let(:theorem) do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes proof_attempt = create :proof_attempt, proof_status: contr
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes proof_attempt.theorem
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes %i(open unknown success disproven_on_subset disproven proven contr).each do |status|
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes context "to status #{status}" do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes before { create :proof_attempt, theorem: theorem, proof_status: send(status) }
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes it "theorem has status unknown" do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes expect(theorem.proof_status).to eq(contr)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes context '- contradictory -' do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes [%w(THM THM), %w(CSA CSA)].each do |statuses|
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes context "#{statuses.first} and #{statuses.last} -" do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes let!(:proof_attempt1) do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes create :proof_attempt, proof_status: ProofStatus.find(statuses.first)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes let!(:theorem) { proof_attempt1.theorem }
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes let!(:proof_attempt2) do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes create :proof_attempt,
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes proof_status: ProofStatus.find(statuses.last),
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes theorem: theorem
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
8410c53aaf5e0372a19d5f4d2bc696b9c609ce3cbnicholes it "theorem is #{statuses.first}" do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes expect(theorem.proof_status.identifier).to eq(statuses.first)
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes end
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes [%w(THM CSAS), %w(CSA CSAS), %w(CSAS THM), %w(CSAS CSA)].each do |statuses|
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes context "#{statuses.first} and #{statuses.last} -" do
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes let!(:proof_attempt1) do
create :proof_attempt, proof_status: ProofStatus.find(statuses.first)
end
let!(:theorem) { proof_attempt1.theorem }
let!(:proof_attempt2) do
create :proof_attempt,
proof_status: ProofStatus.find(statuses.last),
theorem: theorem
end
it "theorem is #{statuses.select { |s| s != 'CSAS'}.first}" do
expect(theorem.proof_status.identifier).
to eq(statuses.select { |s| s != 'CSAS'}.first)
end
end
end
[%w(THM CSA), %w(CSA THM)].each do |statuses|
context "#{statuses.first} and #{statuses.last} -" do
let!(:proof_attempt1) do
create :proof_attempt, proof_status: ProofStatus.find(statuses.first)
end
let!(:theorem) { proof_attempt1.theorem }
let!(:proof_attempt2) do
create :proof_attempt,
proof_status: ProofStatus.find(statuses.last),
theorem: theorem
end
it 'theorem is CONTR' do
expect(theorem.reload.proof_status.identifier).to eq('CONTR')
end
end
end
end
end
end