From 408398706f28b1d8946dc24ccf52c05f97183742 Mon Sep 17 00:00:00 2001 From: Moncef Belyamani Date: Mon, 15 Jul 2013 22:29:20 -0700 Subject: [PATCH] Add link to create a new application on developer portal. Fixes #69 --- app/views/home/index.html.haml | 2 +- spec/features/homepage_text_spec.rb | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 spec/features/homepage_text_spec.rb diff --git a/app/views/home/index.html.haml b/app/views/home/index.html.haml index 7b8cd498d..76b00b1e1 100644 --- a/app/views/home/index.html.haml +++ b/app/views/home/index.html.haml @@ -1,6 +1,6 @@ %h3 Ohana Developers %p - if user_signed_in? - Welcome back #{@user.name}! Create a new application or #{link_to 'view', edit_user_registration_path} your existing ones. + Welcome back #{@user.name}! #{link_to "Create a new application", new_api_application_path} or #{link_to 'view', api_applications_path} your existing ones. - else Sign up for a developer account, or sign in. diff --git a/spec/features/homepage_text_spec.rb b/spec/features/homepage_text_spec.rb new file mode 100644 index 000000000..dfc6db77f --- /dev/null +++ b/spec/features/homepage_text_spec.rb @@ -0,0 +1,26 @@ +feature "Visit home page after signing in" do + # The 'login_as' method is a Warden test helper that + # allows you to simulate a user login without having + # to fill in the sign in form every time. Since we're + # not testing the signing in part of the app here, we + # can take advantage of the Warden helper and speed up + # our integration tests. + + # All other methods are part of the Capybara DSL + # https://github.com/jnicklas/capybara + background do + user = FactoryGirl.create(:user) + login_as(user, :scope => :user) + visit ('/') + end + + scenario "click 'create a new application' link" do + click_link "Create a new application" + expect(page).to have_content "Register a new application" + end + + scenario "click 'view' link" do + click_link "view" + expect(page).to have_content "Developer Applications" + end +end \ No newline at end of file