Sha256: b08c5e3fe26a442878a55a17eb6a6f656510fa0b347b62553012283192ae46c5

Contents?: true

Size: 580 Bytes

Versions: 1

Compression:

Stored size: 580 Bytes

Contents

# frozen_string_literal: true

require 'rails_helper'

RSpec.describe Breadcrumby::Viewer, '.link_action' do
  subject { described_class.new object, options }

  let!(:action)  { :edit }
  let!(:object)  { build :school }
  let!(:options) { {} }

  context 'when action is not given' do
    it 'returns the object show route' do
      expect(subject.link_action(object, nil)).to eq object.show_path
    end
  end

  context 'when action is given' do
    it 'returns an avoid link' do
      expect(subject.link_action(object, action)).to eq 'javascript:void(0);'
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
breadcrumby-0.1.0 spec/lib/breadcrumby/models/viewer/link_action_spec.rb