docbrown/spec/features/user_views_and_closes_onboarding_spec.rb
rhymes e588fa7ece Code cleanups (#659)
* Initial automatic cleanup with rubocop

* Fix syntax error introduced by rubocop

* Cleanup seeds file

* Cleanup lib folder

* Exclude bin folder because it contains auto generated files

* Make Rubocop a little bit more chatty

* Block length should not include comments in the count

* Cleanup config folder

* Cleanup specs

* Updated Rubocop version and generated a todo file

* Fix broken ArticlesApi spec

* Fix tests

* Restored rubocop pre-commit hook
2018-08-07 11:00:13 -04:00

112 lines
3.2 KiB
Ruby

# rubocop:disable Metrics/LineLength
# require "rails_helper"
# describe "User views and closes onboarding", type: :feature, js: true do
# let(:tag) { create(:tag, name: "java") }
# def sign_out
# find("#navbar-menu-wrapper").hover.click_link(href: "/signout_confirm")
# click_link(href: "/users/sign_out")
# end
# def click_sidebar_link
# click_link("GITHUB")
# end
# def sign_up_or_in(provider = "twitter")
# find("#navbar-menu-wrapper").hover.click_link(href: "/users/auth/#{provider}?state=navbar_basic")
# end
# def sign_up_and_close_onboarding
# sign_up_or_in
# button = find(".close-button")
# button.click
# end
# before do
# tag
# visit "/"
# end
# describe "sign up via navbar, notifications, and sidebar goes to onboarding" do
# describe "via navbar" do
# xit "with Twitter" do
# sign_up_or_in("twitter")
# expect(find(".global-modal-inner")).to have_content("WELCOME!")
# end
# xit "with GitHub" do
# sign_up_or_in("github")
# expect(find(".global-modal-inner")).to have_content("WELCOME!")
# end
# end
# describe "via notifications" do
# it "with Twitter" do
# click_link(href: "/notifications")
# click_link("Twitter")
# expect(find(".global-modal-inner")).to have_content("WELCOME!")
# end
# it "with GitHub" do
# click_link(href: "/notifications")
# click_link("GitHub")
# expect(find(".global-modal-inner")).to have_content("WELCOME!")
# end
# end
# describe "via sidebar" do
# it "with Twitter" do
# click_link("TWITTER")
# expect(find(".global-modal-inner")).to have_content("WELCOME!")
# end
# it "with GitHub" do
# click_link("GITHUB")
# expect(find(".global-modal-inner")).to have_content("WELCOME!")
# end
# end
# end
# describe "via in-feed CTA" do
# before do
# 5.times { create(:article, featured: true) }
# visit "/"
# end
# it "with Twitter" do
# # in_feed_link = find_link(href: "/users/auth/twitter?callback_url=https://dev.to/users/auth/twitter/callback")
# # in_feed_link.click
# # expect(find(".global-modal-inner")).to have_content("WELCOME!")
# end
# xit "with GitHub" do
# in_feed_link = find_link(href: "/users/auth/github?state=in-feed-cta")
# in_feed_link.click
# expect(find(".global-modal-inner")).to have_content("WELCOME!")
# end
# end
# describe "onboarding state does not reappear after closing or completing" do
# xit "onboarding closes properly" do
# sign_up_and_close_onboarding
# expect(page).not_to have_selector(".close-button")
# end
# xit "onboarding stays closed after closing" do
# sign_up_and_close_onboarding
# sign_out
# sign_up_or_in
# expect(page).not_to have_selector(".global-modal-inner")
# end
# xit "onboarding stays closed after completing" do
# sign_up_or_in
# 3.times { find(".next_button").click }
# sign_out
# sign_up_or_in
# expect(page).not_to have_selector(".global-modal-inner")
# end
# end
# end
# rubocop:enable Metrics/LineLength