-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing regression on APIPart templates
Error occured when an authenticated user would open non authenticated APIPart pages
- Loading branch information
Showing
2 changed files
with
23 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,32 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.describe 'FAQ & Support', app: :api_particulier do | ||
before do | ||
it 'displays entries' do | ||
visit faq_index_path | ||
end | ||
|
||
it 'displays entries' do | ||
expect(page).to have_css('.faq-entry', count: APIParticulier::FAQEntry.all.count) | ||
end | ||
|
||
it 'has a button to copy anchors on titles', :js do | ||
visit faq_index_path | ||
|
||
APIParticulier::FAQEntry.all do |entry| | ||
expect(page).to have_css("#button-anchor-#{entry.category.parameterize}"), | ||
"Missing button copy-anchor on #{entry.category}" | ||
end | ||
end | ||
|
||
describe 'non regression test' do | ||
let!(:user) { create(:user) } | ||
|
||
before do | ||
login_as(user) | ||
end | ||
|
||
it 'displays the page' do | ||
visit faq_index_path | ||
|
||
expect(page).to have_http_status(:success) | ||
end | ||
end | ||
end |