Sha256: c5d4434be33893f76622ea8ddcd0160b37d3b53905d0534a889862f8a93b5c24

Contents?: true

Size: 955 Bytes

Versions: 47

Compression:

Stored size: 955 Bytes

Contents

# encoding: UTF-8

### Background #
Given /^an ActiveRecord object instance of 'Document'$/ do
  raise unless Document.ancestors.include?(::ActiveRecord::Base)
  @document = Document.create!(:name => 'Fractal', :surname => 'Garden' )
end

Given /^an ActiveRecord object instance of 'User'$/ do
  raise unless User.ancestors.include?(::ActiveRecord::Base)
end
  
### Scenarios #        
Given /^a User "([^"]*)"$/ do |email|
  @current_user = User.create!(:email => email, :firstname => 'John', :lastname => 'smith' )
end

When /^adding the user to the watcherslist of an attribute "([^"]*)"$/ do |attribute|
  @attribute = attribute
  @document.create_watcher_for(@attribute, @current_user)
end

Then /^it should be created a new watcher for that field$/ do
  @document.watchers_for(@attribute).should_not be_nil
end

Then /^added a user to the list of the watcher$/ do
  @document.watchers_for(@attribute).first.owner_id.should be == @current_user.id
end

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
active_metadata-0.7.3 features/step_definitions/add_a_user_to_a_watcher_steps.rb
active_metadata-0.7.2 features/step_definitions/add_a_user_to_a_watcher_steps.rb
active_metadata-0.7.1 features/step_definitions/add_a_user_to_a_watcher_steps.rb
active_metadata-0.7.0 features/step_definitions/add_a_user_to_a_watcher_steps.rb
active_metadata-0.6.9 features/step_definitions/add_a_user_to_a_watcher_steps.rb
active_metadata-0.6.7 features/step_definitions/add_a_user_to_a_watcher_steps.rb
active_metadata-0.6.6 features/step_definitions/add_a_user_to_a_watcher_steps.rb
active_metadata-0.6.5 features/step_definitions/add_a_user_to_a_watcher_steps.rb
active_metadata-0.6.4 features/step_definitions/add_a_user_to_a_watcher_steps.rb
active_metadata-0.6.3 features/step_definitions/add_a_user_to_a_watcher_steps.rb
active_metadata-0.6.2 features/step_definitions/add_a_user_to_a_watcher_steps.rb
active_metadata-0.6.1 features/step_definitions/add_a_user_to_a_watcher_steps.rb
active_metadata-0.6.0 features/step_definitions/add_a_user_to_a_watcher_steps.rb
active_metadata-0.5.2 features/step_definitions/add_a_user_to_a_watcher_steps.rb
active_metadata-0.5.1 features/step_definitions/add_a_user_to_a_watcher_steps.rb
active_metadata-0.5.0 features/step_definitions/add_a_user_to_a_watcher_steps.rb
active_metadata-0.4.2 features/step_definitions/add_a_user_to_a_watcher_steps.rb
active_metadata-0.4.1 features/step_definitions/add_a_user_to_a_watcher_steps.rb
active_metadata-0.3.2 features/step_definitions/add_a_user_to_a_watcher_steps.rb
active_metadata-0.3.1 features/step_definitions/add_a_user_to_a_watcher_steps.rb