From 33d1948bda9537f7c0af630fc92308a1047bdd06 Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Fri, 6 Sep 2013 13:44:35 +1000 Subject: [PATCH] Display log in / sign up links on landing page --- app/views/home/temp_landing_page.html.haml | 9 +++++++++ .../consumer/temp_landing_page_spec.rb | 18 +++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/app/views/home/temp_landing_page.html.haml b/app/views/home/temp_landing_page.html.haml index 212c3a1309..5f974531c8 100644 --- a/app/views/home/temp_landing_page.html.haml +++ b/app/views/home/temp_landing_page.html.haml @@ -12,6 +12,15 @@ = csrf_meta_tags %body + - unless spree_current_user + %nav.top-bar + %ul.title-area + %li.name + %section.top-bar-section + %ul.right + %li= link_to 'Log in', spree.login_path + %li= link_to 'Sign up', spree.signup_path + .row.landing-page-row.with-bottom-border .large-12.columns.centered = image_tag "ofn_logo_black.png" diff --git a/spec/features/consumer/temp_landing_page_spec.rb b/spec/features/consumer/temp_landing_page_spec.rb index 3b390305d8..29329ee171 100644 --- a/spec/features/consumer/temp_landing_page_spec.rb +++ b/spec/features/consumer/temp_landing_page_spec.rb @@ -5,6 +5,7 @@ feature %q{ I want to see the landing page So I choose a distributor }, js: true do + include AuthenticationWorkflow background do # for the link to be visible, it would also have to be in 'distributors.yml' @@ -23,9 +24,24 @@ feature %q{ end end + describe "account links" do + it "should display log in and sign up links when signed out" do + page.should have_link 'Log in' + page.should have_link 'Sign up' + end + + it "should not display links when signed in" do + login_to_consumer_section + visit root_path + + page.should_not have_link 'Log in' + page.should_not have_link 'Sign up' + end + end + describe "hub list" do it "should display hub link" do - page.should have_link("Green Grass") + page.should have_link "Green Grass" end it "should link to the hub page" do