controller_resources 0.0.6 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,46 +0,0 @@
1
- require 'spec_helper'
2
-
3
- # :nodoc:
4
- class User
5
- end
6
-
7
- # :nodoc:
8
- module ControllerResources
9
- RSpec.describe Resource do
10
- subject do
11
- Resource.new :user do |r|
12
- r.search :name
13
- r.modify :name, :password
14
- end
15
- end
16
-
17
- it 'has a name' do
18
- expect(subject.name).to eq('user')
19
- end
20
-
21
- it 'starts with given search params' do
22
- expect(subject.search_params).to include(:name)
23
- end
24
-
25
- it 'starts with given editing params' do
26
- expect(subject.edit_params).to include(:name)
27
- expect(subject.edit_params).to include(:password)
28
- end
29
-
30
- it 'configures search params' do
31
- subject.search :title
32
- expect(subject.search_params).to include(:title)
33
- expect(subject.search_params).to_not include(:name)
34
- end
35
-
36
- it 'configures editing params' do
37
- subject.modify :token
38
- expect(subject.edit_params).to include(:token)
39
- expect(subject.edit_params).to_not include(:password)
40
- end
41
-
42
- it 'provides the user class name' do
43
- expect(subject.model_class).to eq(User)
44
- end
45
- end
46
- end