added before and after actions

+ before initializes the db
+ after cleans the db
pull/21/head
Adam Townsend 2023-10-12 11:40:15 -07:00
parent d1a0fc0222
commit 2964e06639
1 changed files with 6 additions and 0 deletions

View File

@ -13,6 +13,12 @@ end
describe "Submit API request to create new link" do describe "Submit API request to create new link" do
include Rack::Test::Methods include Rack::Test::Methods
before :each do
@links = Sequel.sqlite("db/#{ENV['DB_NAME']}")[:links]
end
after :each do
@links.delete
end
it "should return link data in json format when a valid url is entered" do it "should return link data in json format when a valid url is entered" do
data = { data = {
url: 'http://google.com' url: 'http://google.com'