spec/lib/micropub/server/rails/middleware_spec.rb in micropub-server-rails-0.1.7 vs spec/lib/micropub/server/rails/middleware_spec.rb in micropub-server-rails-0.1.8

- old
+ new

@@ -1,12 +1,9 @@ require "micropub/server/rails/middleware" require 'webmock/rspec' require "rack/test" -# How do we determine what host to hit? -# Where does the code go which tells the mapping how to notes to work? - Micropub.configure do |c| c.token_endpoint = "https://tokens.indieauth.com/token" c.me = "http://bookisworthy.com" c.allowed_scopes = [:post] end @@ -20,9 +17,21 @@ describe "invalid route" do it "calls `call` on parent app" do expect(rails).to receive(:call).and_return [200, {}, [""]] get "/" + end + end + + describe "GET /micropub?q=syndicate-to" do + it "returns a 200" do + get "/micropub", q: "synicate-to" + expect(last_response.status).to eq 200 + end + + it "returns an http array called syndicate-to" do + get "/micropub", q: "synicate-to" + expect(last_response.body).to match /syndicate-to/ end end describe "POST /micropub" do before do