Compare commits
No commits in common. "a0be5c699a4ff4e7d40b076e73af365a4fc73ade" and "be17e2f14626e9558b56ce61690cd5c770940b7f" have entirely different histories.
a0be5c699a
...
be17e2f146
4
Gemfile
4
Gemfile
|
|
@ -14,7 +14,7 @@ gem "sqlite3", "~> 1.6"
|
||||||
|
|
||||||
gem "erubi", "~> 1.12"
|
gem "erubi", "~> 1.12"
|
||||||
|
|
||||||
group :test do
|
group :development do
|
||||||
|
|
||||||
gem "cucumber", "~> 9.0"
|
gem "cucumber", "~> 9.0"
|
||||||
|
|
||||||
|
|
@ -24,6 +24,4 @@ group :test do
|
||||||
|
|
||||||
gem "selenium-webdriver", "~> 4.13"
|
gem "selenium-webdriver", "~> 4.13"
|
||||||
|
|
||||||
gem "simplecov"
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,6 @@ GEM
|
||||||
cucumber-messages (21.0.1)
|
cucumber-messages (21.0.1)
|
||||||
cucumber-tag-expressions (4.1.0)
|
cucumber-tag-expressions (4.1.0)
|
||||||
diff-lcs (1.5.0)
|
diff-lcs (1.5.0)
|
||||||
docile (1.4.0)
|
|
||||||
erubi (1.12.0)
|
erubi (1.12.0)
|
||||||
falcon (0.42.3)
|
falcon (0.42.3)
|
||||||
async
|
async
|
||||||
|
|
@ -139,12 +138,6 @@ GEM
|
||||||
websocket (~> 1.0)
|
websocket (~> 1.0)
|
||||||
sequel (5.73.0)
|
sequel (5.73.0)
|
||||||
bigdecimal
|
bigdecimal
|
||||||
simplecov (0.22.0)
|
|
||||||
docile (~> 1.1)
|
|
||||||
simplecov-html (~> 0.11)
|
|
||||||
simplecov_json_formatter (~> 0.1)
|
|
||||||
simplecov-html (0.12.3)
|
|
||||||
simplecov_json_formatter (0.1.4)
|
|
||||||
sqlite3 (1.6.6)
|
sqlite3 (1.6.6)
|
||||||
mini_portile2 (~> 2.8.0)
|
mini_portile2 (~> 2.8.0)
|
||||||
sys-uname (1.2.3)
|
sys-uname (1.2.3)
|
||||||
|
|
@ -168,7 +161,6 @@ DEPENDENCIES
|
||||||
rspec (~> 3.12)
|
rspec (~> 3.12)
|
||||||
selenium-webdriver (~> 4.13)
|
selenium-webdriver (~> 4.13)
|
||||||
sequel (~> 5.72)
|
sequel (~> 5.72)
|
||||||
simplecov
|
|
||||||
sqlite3 (~> 1.6)
|
sqlite3 (~> 1.6)
|
||||||
tilt (~> 2.2)
|
tilt (~> 2.2)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,9 +33,3 @@ Feature: Homepage
|
||||||
And I click the "Submit" button
|
And I click the "Submit" button
|
||||||
Then I should be on "/create" page
|
Then I should be on "/create" page
|
||||||
And I should see the message "Link exists"
|
And I should see the message "Link exists"
|
||||||
|
|
||||||
@db-test
|
|
||||||
Scenario: Accessing the URL based on the shortcode
|
|
||||||
Given A link already exists with the url "https://google.com" and code "aaaaaa"
|
|
||||||
When I visit the "/aaaaaa" location
|
|
||||||
Then I should be redirected to "https://google.com"
|
|
||||||
|
|
|
||||||
|
|
@ -13,10 +13,6 @@ Given('A link already exists with the url {string}') do |string|
|
||||||
@links.insert(url: string, code: "aaaaaa")
|
@links.insert(url: string, code: "aaaaaa")
|
||||||
end
|
end
|
||||||
|
|
||||||
Given('A link already exists with the url {string} and code {string}') do |url, code|
|
|
||||||
@links.insert(url: url, code: code)
|
|
||||||
end
|
|
||||||
|
|
||||||
# WHEN
|
# WHEN
|
||||||
|
|
||||||
When('I click the {string} button') do |string|
|
When('I click the {string} button') do |string|
|
||||||
|
|
@ -27,10 +23,6 @@ When('I type {string} in the {string} field') do |text, field|
|
||||||
fill_in field, with: text
|
fill_in field, with: text
|
||||||
end
|
end
|
||||||
|
|
||||||
When('I visit the {string} location') do |string|
|
|
||||||
visit string
|
|
||||||
end
|
|
||||||
|
|
||||||
# THEN
|
# THEN
|
||||||
|
|
||||||
Then('I should see text {string}') do |string|
|
Then('I should see text {string}') do |string|
|
||||||
|
|
@ -53,11 +45,6 @@ Then('I should see the message {string}') do |message|
|
||||||
page.should have_selector '#message', text: message
|
page.should have_selector '#message', text: message
|
||||||
end
|
end
|
||||||
|
|
||||||
Then('I should be redirected to {string}') do |string|
|
|
||||||
actual = URI.parse(current_url).to_s
|
|
||||||
location = actual.index(string)
|
|
||||||
location.should equal(0)
|
|
||||||
end
|
|
||||||
# AFTER
|
# AFTER
|
||||||
|
|
||||||
After('@db-test') do
|
After('@db-test') do
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,3 @@
|
||||||
require 'simplecov'
|
|
||||||
SimpleCov.start
|
|
||||||
|
|
||||||
require_relative '../../.env'
|
require_relative '../../.env'
|
||||||
ENV["DB_NAME"] = "test_#{ENV["DB_NAME"]}"
|
ENV["DB_NAME"] = "test_#{ENV["DB_NAME"]}"
|
||||||
require_relative '../../app'
|
require_relative '../../app'
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue