Initial commit

This commit is contained in:
2023-01-27 22:55:09 +11:00
commit 833f3ea8b2
130 changed files with 5637 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
RSpec.describe Adamantium::MicropubRequestParser do
subject { described_class.new }
context "json request" do
context "HTML post" do
let(:params) {
{
type: ["h-entry"],
properties: {
name: ["title"],
content: [
"Hello world"
]
},
category: ["ruby", "rspec"]
}
}
it "parses the params in to the expected shape" do
Timecop.freeze do
result = subject.call(params: params)
expect(result).to be_a Adamantium::Entities::PostRequest
end
end
end
end
context "form request" do
let(:params) {
{
h: "entry",
name: "title",
content: "Hello world",
category: ["ruby", "rspec"]
}
}
it "parses the params in to the expected shape" do
Timecop.freeze do
result = subject.call(params: params)
expect(result).to be_a Adamantium::Entities::PostRequest
end
end
end
end