Skip to content

Commit

Permalink
Merge pull request #6 from AlchemyCMS/fix-specs-bump-version
Browse files Browse the repository at this point in the history
Fix specs, bump version
  • Loading branch information
tvdeyen authored Sep 15, 2020
2 parents 32475f6 + 7174c85 commit 9e5c120
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 17 deletions.
2 changes: 1 addition & 1 deletion alchemy-json_api.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Gem::Specification.new do |spec|

spec.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.md"]

spec.add_dependency "alchemy_cms"
spec.add_dependency "alchemy_cms", "~> 5.0"
spec.add_dependency "fast_jsonapi", "~> 1.5"
spec.add_dependency "jsonapi.rb"

Expand Down
2 changes: 1 addition & 1 deletion app/serializers/alchemy/json_api/element_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class ElementSerializer
:updated_at,
)
attribute :element_type, &:name
belongs_to :parent_element, record_type: :element
belongs_to :parent_element, record_type: :element, serializer: self

belongs_to :page
has_many :essences, polymorphic: true do |element|
Expand Down
2 changes: 1 addition & 1 deletion app/serializers/alchemy/json_api/node_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class NodeSerializer
attribute :link_title, &:title
attribute :link_nofollow, &:nofollow

belongs_to :parent, record_type: :node
belongs_to :parent, record_type: :node, serializer: self

has_many :children, record_type: :node, serializer: self
end
Expand Down
2 changes: 1 addition & 1 deletion lib/alchemy/json_api/version.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true
module Alchemy
module JsonApi
VERSION = "0.1.0"
VERSION = "0.2.0"
end
end
8 changes: 4 additions & 4 deletions spec/requests/alchemy/json_api/layout_pages_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
FactoryBot.create(
:alchemy_page,
:public,
:layoutpage,
urlname: nil,
title: "Footer",
layoutpage: true,
title: "Footer"
)
end

Expand Down Expand Up @@ -45,8 +45,8 @@

context "when the language is incorrect" do
let!(:language) { FactoryBot.create(:alchemy_language) }
let!(:other_language) { FactoryBot.create(:alchemy_language, :english) }
let(:page) { FactoryBot.create(:alchemy_page, :public, layoutpage: true, language: other_language) }
let!(:other_language) { FactoryBot.create(:alchemy_language, :german) }
let(:page) { FactoryBot.create(:alchemy_page, :public, :layoutpage, language: other_language) }

it "returns a 404" do
get alchemy_json_api.layout_page_path(page.urlname)
Expand Down
2 changes: 1 addition & 1 deletion spec/requests/alchemy/json_api/pages_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

context "when the language is incorrect" do
let!(:language) { FactoryBot.create(:alchemy_language) }
let!(:other_language) { FactoryBot.create(:alchemy_language, :english) }
let!(:other_language) { FactoryBot.create(:alchemy_language, :german) }
let(:page) { FactoryBot.create(:alchemy_page, :public, language: other_language) }

it "returns a 404" do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@

RSpec.describe Alchemy::JsonApi::LanguageSerializer do
let(:language) do
FactoryBot.create(
:alchemy_language,
country_code: "DE",
language_code: "de",
)
FactoryBot.create(:alchemy_language, :german, country_code: "DE")
end
let(:options) { {} }

Expand Down
5 changes: 2 additions & 3 deletions spec/serializers/alchemy/json_api/page_serializer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
expect(attributes[:name]).to eq(page.name)
expect(attributes[:page_layout]).to eq("standard")
expect(attributes[:title]).to eq("Page Title")
expect(attributes[:language_code]).to eq("de")
expect(attributes[:language_code]).to eq("en")
expect(attributes[:meta_keywords]).to eq("Meta Keywords")
expect(attributes[:meta_description]).to eq("Meta Description")
expect(attributes[:created_at]).to eq(page.created_at)
Expand All @@ -44,8 +44,7 @@
{
public: false,
locked: false,
restricted: false,
visible: false,
restricted: false
},
)
end
Expand Down

0 comments on commit 9e5c120

Please sign in to comment.