From c0107e2bc44d157e0858e425376b2f92768b6cc5 Mon Sep 17 00:00:00 2001 From: Karina Kwiatek Date: Fri, 6 Aug 2021 22:33:02 +0200 Subject: [PATCH] Add test for rails_admin_path_for_resource --- spec/helpers/application_helper_spec.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 spec/helpers/application_helper_spec.rb diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb new file mode 100644 index 00000000..948bc479 --- /dev/null +++ b/spec/helpers/application_helper_spec.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +require "rails_helper" + +describe ApplicationHelper, :type => :helper do + describe "#rails_admin_path_for_resource" do + context "user resource" do + let(:resource) { FactoryBot.create(:user) } + subject { rails_admin_path_for_resource(resource) } + + it "should return a URL to the given resource within rails admin" do + expect(subject).to eq("/justask_admin/user/#{resource.id}") + end + end + end +end \ No newline at end of file