Commit fd69f020 authored by Stephen Caudill's avatar Stephen Caudill

User creates an aspect

parent 3e499c0f
......@@ -14,8 +14,12 @@ class AspectsController < ApplicationController
end
def create
@aspect = current_user.aspect params[:aspect]
flash[:notice] = I18n.t('aspects.create.success')
@aspect = current_user.aspect(params[:aspect])
if @aspect.valid?
flash[:notice] = I18n.t('aspects.create.success')
else
flash[:notice] = I18n.t('aspects.create.failure')
end
respond_with :location => aspects_manage_path
end
......
......@@ -86,6 +86,7 @@ en:
create: "Create"
create:
success: "Click on the plus on the left side to tell Diaspora who can see your new aspect."
failure: "Aspect creation failed."
destroy:
success: "%{name} was successfully removed."
update:
......
When /^(.*) in the header$/ do |action|
within('header') do
When action
end
end
When /^(.*) in the modal window$/ do |action|
within('#fancybox-wrap') do
When action
end
end
When /^(.*) in the aspect list$/ do |action|
within('#aspect_list') do
When action
end
end
......@@ -9,7 +9,7 @@ end
World(SectionLocator)
sections = %w(h1 h2 h3 h4 h5 h6 legend caption dt strong)
sections = %w(h1 h2 h3 h4 h5 h6 legend caption dt strong header)
When /^(.*) in the "([^\"]*)" section$/ do |action, title|
within_parent(title, sections) do
......
@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
Scenario: success
Given I am signed in
And I follow "Manage" in the header
And I follow "Add a new aspect"
When I fill in "Name" with "Dorm Mates" in the modal window
And I press "Create" in the modal window
Then I should see "Manage Aspects"
And I should see "Dorm Mates" in the header
And I should see "Dorm Mates" in the aspect list
Scenario: I omit the name
Given I am signed in
And I follow "Manage" in the header
And I follow "Add a new aspect"
When I press "Create" in the modal window
Then I should see "Manage Aspects"
And I should see "Aspect creation failed."
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment