Sha256: 4e7f39e11139c97e9a7d8f098f65fe436a7a691cab9395ff8f4d3dde88b65f7b
Contents?: true
Size: 820 Bytes
Versions: 9
Compression:
Stored size: 820 Bytes
Contents
require 'spec_helper' RSpec.describe NsSettingsUi::ApplicationHelper, type: :helper do describe '#url_for' do subject { helper.url_for(url_params) } context 'on self route' do let(:url_params) { NsSettingsUi::Engine.routes.url_helpers.settings_path } it { is_expected.to eq('/ns_settings_ui/settings') } end context 'on main application route' do let(:url_params) { {controller: '/home'} } it { is_expected.to eq('/home') } end context 'on incorrect route' do let(:url_params) { {controller: 'non-existing-controller', action: 'index'} } let(:error_class) do Rails::VERSION::MAJOR <= 3 ? ActionController::RoutingError : ActionController::UrlGenerationError end it { expect { subject }.to raise_error(error_class) } end end end
Version data entries
9 entries across 9 versions & 1 rubygems