Sha256: 30e3f8fa55bdeacadc2c8b84ad01c43e913f99d8aa00724f883c64bd81526cfb

Contents?: true

Size: 1.04 KB

Versions: 7

Compression:

Stored size: 1.04 KB

Contents

require 'spec_helper'

describe ContributorAgreement do
  subject { ContributorAgreement.new(curation_concern, user, params) }
  let(:curation_concern) { MockCurationConcern.new }
  let(:user) { User.new }
  let(:params) { {} }


  it 'has legally binding text' do
    subject.legally_binding_text.should be_kind_of(String)
  end

  it 'has acceptance value' do
    subject.acceptance_value.should == 'accept'
  end

  it 'has param key' do
    subject.param_key.should == :accept_contributor_agreement
  end

  describe 'without acceptance' do
    let(:params) { {} }

    it 'has param value' do
      subject.param_value.should == nil
    end

    it 'is most definitely not being accepted' do
      subject.is_being_accepted?.should == false
    end
  end

  describe 'with acceptance' do
    let(:params) { {accept_contributor_agreement: 'accept'} }

    it 'has a param value of "accept"' do
      subject.param_value.should == 'accept'
    end

    it 'is in the process of being accepted' do
      subject.is_being_accepted?.should == true
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
curate-0.3.2 spec/models/contributor_agreement_spec.rb
curate-0.3.1 spec/models/contributor_agreement_spec.rb
curate-0.2.0 spec/models/contributor_agreement_spec.rb
curate-0.1.3 spec/models/contributor_agreement_spec.rb
curate-0.1.2 spec/models/contributor_agreement_spec.rb
curate-0.1.1 spec/models/contributor_agreement_spec.rb
curate-0.1.0 spec/models/contributor_agreement_spec.rb