bakineggs (owner)

Revisions

gist: 164476 Download_button fork
public
Public Clone URL: git://gist.github.com/164476.git
Embed All Files: show embed
device_steps.rb #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
When 'I create a device' do
  @device_options ||= {}
  @device_options[:brand] ||= Faker::Lorem.words(2).join
  @device_options[:model] ||= Faker::Lorem.words(2).join
  @device_options[:device_id] ||= @device_options[:model] + rand(1000).to_s
  post '/devices.xml', :device => @device_options, :user_credentials => @user.try(:single_access_token)
end
 
When 'I create a device without a device id' do
  @device_options ||= {}
  @device_options[:device_id] = ''
  When 'I create a device'
end
 
When 'I create a device with the same device id' do
  @device_options = {:device_id => @device_options[:device_id]}
  When 'I create a device'
end
 
When 'I create a device without a brand' do
  @device_options ||= {}
  @device_options[:brand] = ''
  When 'I create a device'
end
 
When 'I create a device without a model' do
  @device_options ||= {}
  @device_options[:model] = ''
  When 'I create a device'
end
 
When 'I create a device for the user' do
  @device_options ||= {}
  @device_options[:user_id] = @user.id
  When 'I create a device'
end
 
When 'I create a device for a different user' do
  @device_options ||= {}
  @device_options[:user_id] = create_user.id
  When 'I create a device'
end