Skip to content

Commit

Permalink
Revert "Weak-public but still some kind-of-public Browser API"
Browse files Browse the repository at this point in the history
This reverts commit 4f6ea6d.
  • Loading branch information
mostlyobvious committed Jun 24, 2022
1 parent 353ab29 commit 359ba08
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions ruby_event_store-browser/spec/root_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,22 @@
module RubyEventStore
RSpec.describe Browser do
specify { expect(test_client.get("/")).to be_ok }

specify { expect(test_client.post("/")).to be_not_found }

specify { expect(test_client.get("/streams/all")).to be_ok }

specify do
event_store.append(DummyEvent.new(event_id: event_id))
expect(test_client.get("/events/#{event_id}")).to be_ok
end

specify { expect(test_client.get("/").content_type).to eq("text/html;charset=utf-8") }

specify { expect(Browser::App.for(event_store_locator: -> { event_store })).to be_a(Browser::App) }

let(:event_store) { RubyEventStore::Client.new(repository: RubyEventStore::InMemoryRepository.new) }
let(:test_client) { TestClient.new(app_builder(event_store), "www.example.com") }
let(:event_id) { SecureRandom.uuid }

def app_builder(event_store)
Rack::Lint.new(RubyEventStore::Browser::App.for(event_store_locator: -> { event_store }))
Rack::Lint.new(
RubyEventStore::Browser::App.for(event_store_locator: -> { event_store })
)
end
end
end

0 comments on commit 359ba08

Please sign in to comment.