Sha256: 6feaa02a95537a27c4fe727e3cb2ba78e7804d585a932b60c291e14bceecc944

Contents?: true

Size: 1.03 KB

Versions: 2

Compression:

Stored size: 1.03 KB

Contents

require "test_helper"

class Replication::Modules::SemiConservativeTest < ActiveSupport::TestCase

  test "unwound with default options" do
    Organism.can_replicate
    organism = organism_object
    strand = organism.unwound(name: 'First bacteria')

    assert_equal organism.strand_attributes, strand.pairs
  end

  test "replicate with default options" do
    Organism.can_replicate
    organism = organism_object
    strand = organism.replicate(name: 'First bacteria')

    assert_equal organism.strand_attributes, strand.pairs
  end

  test "unwound with whitelist" do
    Organism.can_replicate only: [:name]
    organism = organism_object
    strand = organism.replicate(name: 'First bacteria')

    assert_equal ({ name: 'Bacteria' }), strand.pairs
  end

  test "unwound with blacklist" do
    Organism.can_replicate except: [:id, :number_of_legs, :birth_date, :created_at, :updated_at]
    organism = organism_object
    strand = organism.replicate(name: 'First bacteria')

    assert_equal ({ name: 'Bacteria' }), strand.pairs
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
replication-0.4.1 test/replication/modules/semi_conservative_test.rb
replication-0.4.0 test/replication/modules/semi_conservative_test.rb