Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
c3641185
Commit
c3641185
authored
Dec 15, 2018
by
Lin Jen-Shin
Committed by
Rémy Coutable
Dec 19, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix cacheable_attributes_spec.rb by adding column_names
parent
25ef6f51
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
spec/models/concerns/cacheable_attributes_spec.rb
spec/models/concerns/cacheable_attributes_spec.rb
+6
-2
No files found.
spec/models/concerns/cacheable_attributes_spec.rb
View file @
c3641185
...
@@ -20,6 +20,10 @@ describe CacheableAttributes do
...
@@ -20,6 +20,10 @@ describe CacheableAttributes do
@_last
||=
new
(
'foo'
=>
'a'
,
'bar'
=>
'b'
)
@_last
||=
new
(
'foo'
=>
'a'
,
'bar'
=>
'b'
)
end
end
def
self
.
column_names
%w[foo bar baz]
end
attr_accessor
:attributes
attr_accessor
:attributes
def
initialize
(
attrs
=
{},
*
)
def
initialize
(
attrs
=
{},
*
)
...
@@ -75,13 +79,13 @@ describe CacheableAttributes do
...
@@ -75,13 +79,13 @@ describe CacheableAttributes do
context
'without any attributes given'
do
context
'without any attributes given'
do
it
'intializes a new object with the defaults'
do
it
'intializes a new object with the defaults'
do
expect
(
minimal_test_class
.
build_from_defaults
.
attributes
).
to
eq
(
minimal_test_class
.
defaults
)
expect
(
minimal_test_class
.
build_from_defaults
.
attributes
).
to
eq
(
minimal_test_class
.
defaults
.
stringify_keys
)
end
end
end
end
context
'with attributes given'
do
context
'with attributes given'
do
it
'intializes a new object with the given attributes merged into the defaults'
do
it
'intializes a new object with the given attributes merged into the defaults'
do
expect
(
minimal_test_class
.
build_from_defaults
(
foo:
'd'
).
attributes
[
:foo
]).
to
eq
(
'd'
)
expect
(
minimal_test_class
.
build_from_defaults
(
foo:
'd'
).
attributes
[
'foo'
]).
to
eq
(
'd'
)
end
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment