Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix paged specs for Rails 6 #2004

Merged
merged 3 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ jobs:
plugin-name: pageflow_paged
rspec-command: bin/rspec

- engine-name: pageflow_paged
ruby-version: 3.2
rails-version: "~> 6.1"
engine-directory: entry_types/paged
plugin-name: pageflow_paged
rspec-command: bin/rspec

- engine-name: pageflow_scrolled
ruby-version: 2.6
engine-directory: entry_types/scrolled
Expand Down
6 changes: 3 additions & 3 deletions doc/creating_entry_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ editor.registerEntryType('rainbow', {

browserNotSupportedView: BrowserNotSupportedView
});
```
```

### REST Controllers

Expand Down Expand Up @@ -287,10 +287,10 @@ module Rainbow

describe '#create' do
it 'succeeds' do
entry = create(:entry)
entry = create(:entry, entry_type: 'rainbow')

authorize_for_editor_controller(entry)
post(:create, params: {entry_id: entry.id}, format: 'json')
post(:create, params: {entry_type: 'rainbow', entry_id: entry.id}, format: 'json')

expect(response.status).to eq(204)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ def main_app
entry = create(:entry)

authorize_for_editor_controller(entry)
get(:partials, params: {entry_id: entry})
get(:partials, params: {entry_type: 'paged', entry_id: entry})

expect(response.status).to eq(200)
end

it 'requires authentication' do
entry = create(:entry)

get(:partials, params: {entry_id: entry})
get(:partials, params: {entry_type: 'paged', entry_id: entry})

expect(response).to redirect_to(main_app.new_user_session_path)
end
Expand All @@ -55,7 +55,7 @@ def main_app
create(:widget, subject: entry.draft, role: 'footer', type_name: 'non_editor_widget')

authorize_for_editor_controller(entry)
get(:partials, params: {entry_id: entry})
get(:partials, params: {entry_type: 'paged', entry_id: entry})

expect(response.body).to have_selector('div.test_widget')
expect(response.body).not_to have_selector('div.non_editor_widget')
Expand All @@ -76,7 +76,7 @@ def main_app
entry.draft.update(locale: 'de')

authorize_for_editor_controller(entry)
get(:partials, params: {entry_id: entry})
get(:partials, params: {entry_type: 'paged', entry_id: entry})

expect(response.body).to have_selector('div[lang=de]')
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ module PageflowPaged
pageflow_configure do |config|
config.for_entry_type(PageflowPaged.entry_type) do |c|
c.page_types.register(Pageflow::TestPageType.new(name: 'test',
template_path: 'test/page.html.erb'))
template_path: 'test/page'))
end
end

Expand Down