added before and after actions
+ before initializes the db + after cleans the db
This commit is contained in:
@@ -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'
|
||||||
|
|||||||
Reference in New Issue
Block a user