Sha256: f2fcd66f07dcb375a5934160ba813a0263a61c0fe6369e4f354fbaa7e0bd92c1

Contents?: true

Size: 671 Bytes

Versions: 5

Compression:

Stored size: 671 Bytes

Contents

# frozen_string_literal: true

require 'rails_helper'
require 'support/shared_context/with_database_records'

RSpec.describe Voting::Voting, ':values_data' do
  include_context 'with_database_records'

  context 'with no scopeable' do
    subject(:voting) { described_class.values_data comment_1, nil }

    it { expect(voting.as_json['voting_positive']).to eq 2 }

    it { expect(voting.as_json['voting_negative']).to eq 1 }
  end

  context 'with scopeable' do
    subject(:voting) { described_class.values_data comment_1, category }

    it { expect(voting.as_json['voting_positive']).to eq 1 }

    it { expect(voting.as_json['voting_negative']).to eq 1 }
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
voting-0.5.0 spec/models/voting/values_data_spec.rb
voting-0.4.0 spec/models/voting/values_data_spec.rb
voting-0.3.0 spec/models/voting/values_data_spec.rb
voting-0.2.0 spec/models/voting/values_data_spec.rb
voting-0.1.0 spec/models/voting/values_data_spec.rb