diff --git a/Gemfile b/Gemfile index 70a944119..4e8b65d55 100644 --- a/Gemfile +++ b/Gemfile @@ -60,7 +60,7 @@ group :test do gem 'rspec-rails', '>= 2.0.0' gem 'mocha' gem 'database_cleaner', '0.5.2' - gem 'webmock' + gem 'webmock', :require => false gem 'jasmine', :path => 'vendor/gems/jasmine', :require => false gem 'mongrel', :require => false if RUBY_VERSION.include? "1.8" end diff --git a/features/manages_aspects.feature b/features/manages_aspects.feature new file mode 100644 index 000000000..74f6744f4 --- /dev/null +++ b/features/manages_aspects.feature @@ -0,0 +1,14 @@ +@aspects @javascript +Feature: User manages aspects + In order to share with a limited group + As a User + I want to create new aspects + + Scenario: creating an aspect + Given I am signed in + When I follow "Manage" in the header + And I follow "Add a new aspect" + And I fill in "Name" with "Dorm Mates" in the modal window + And I press "Create" in the modal window + Then I should see "Dorm Mates" in the header + And I should see "Your aspect 'Dorm Mates' is empty." diff --git a/features/signs_up.feature b/features/signs_up.feature index 59d34f3fa..d449034cf 100644 --- a/features/signs_up.feature +++ b/features/signs_up.feature @@ -1,19 +1,40 @@ +@javascript Feature: new user registration - Scenario: new user sees profile wizard + Background: When I go to the new user registration page And I fill in "Username" with "ohai" And I fill in "Email" with "ohai@example.com" - And I fill in "Password" with "secret" + And I fill in "user_password" with "secret" And I fill in "Password confirmation" with "secret" And I press "Sign up" Then I should be on the getting started page And I should see "Welcome to Diaspora!" + Scenario: new user goes through the setup wizard When I fill in "person_profile_first_name" with "O" And I fill in "person_profile_last_name" with "Hai" And I press "Save and continue" Then I should see "Profile updated" And I should see "Your aspects" +# Not working with selenium - it thinks the aspect name field is hidden +# When I fill in "Aspect name" with "cheez friends" +# And I press "Add" +# And show me the page +# Then I should see "cheez friends" + When I follow "Save and continue" + Then I should see "Your services" + When I follow "Save and continue" + Then I should see "You're all set up, O!" + + When I follow "Continue on to your everyone page, an overview of all of your aspects." + Then I should be on the home page + And I should see "We know you have friends, bring them to Diaspora!" + + Scenario: new user skips the setup wizard + When I follow "skip getting started" + And I wait for the home page to load + Then I should be on the home page + And I should see "We know you have friends, bring them to Diaspora!" diff --git a/features/step_definitions/custom_web_steps.rb b/features/step_definitions/custom_web_steps.rb index d213cbf4d..c98150d3d 100644 --- a/features/step_definitions/custom_web_steps.rb +++ b/features/step_definitions/custom_web_steps.rb @@ -20,4 +20,8 @@ Then /^I should see "([^\"]*)" in the main content area$/ do |stuff| within("#stream") do Then "I should see #{stuff}" end +end + +When /^I wait for the home page to load$/ do + wait_until { current_path == root_path } end \ No newline at end of file diff --git a/features/support/env.rb b/features/support/env.rb index 2fb86c4dc..f196e1776 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -22,8 +22,6 @@ require 'cucumber/rails/capybara_javascript_emulation' # Lets you click links wi # steps to use the XPath syntax. Capybara.default_selector = :css -WebMock.disable_net_connect!(:allow_localhost => true) - # If you set this to false, any error raised from within your app will bubble # up to your step definition and out to cucumber unless you catch it somewhere # on the way. You can make Rails rescue errors and render error pages on a diff --git a/features/support/paths.rb b/features/support/paths.rb index 3d3f64724..9a08357a0 100644 --- a/features/support/paths.rb +++ b/features/support/paths.rb @@ -1,6 +1,8 @@ module NavigationHelpers def path_to(page_name) case page_name + when /^the home page$/ + root_path when /^its ([\w ]+) page$/ send("#{$1.gsub(/\W+/, '_')}_path", @it) when /^the ([\w ]+) page$/ diff --git a/features/user_creates_an_aspect.feature b/features/user_creates_an_aspect.feature deleted file mode 100644 index d611d412f..000000000 --- a/features/user_creates_an_aspect.feature +++ /dev/null @@ -1,21 +0,0 @@ -@aspects @javascript -Feature: User creates an aspect - In order to share with a limited group - As a User - I want to create a new aspect - - Background: - Given I am signed in - And I follow "Manage" in the header - And I follow "Add a new aspect" - - Scenario: success - Given I fill in "Name" with "Dorm Mates" in the modal window - When I press "Create" in the modal window - Then I should see "Dorm Mates" in the header - And I should see "Your aspect 'Dorm Mates' is empty." - - Scenario: I omit the name - Given I fill in "Name" with "" in the modal window - When I press "Create" in the modal window - Then I should see "Aspect creation failed."