add cancan for authorization

This commit is contained in:
Alex Turchyn
2023-09-17 00:45:57 +03:00
parent f89c50d096
commit 2f1843151d
58 changed files with 343 additions and 186 deletions
+2
View File
@@ -23,6 +23,7 @@ RSpec.describe 'Dashboard Page' do
context 'when there are templates' do
let!(:authors) { create_list(:user, 5, account:) }
let!(:templates) { authors.map { |author| create(:template, account:, author:) } }
let!(:other_template) { create(:template) }
before do
visit root_path
@@ -35,6 +36,7 @@ RSpec.describe 'Dashboard Page' do
end
expect(page).to have_content('Templates')
expect(page).not_to have_content(other_template.name)
expect(page).to have_link('Create', href: new_template_path)
end