New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add helper methods for configuring Views #202
Conversation
@@ -15,7 +15,7 @@ if defined?(RSpec) | |||
|
|||
desc "Run live specs" | |||
RSpec::Core::RakeTask.new("spec:live") do |t| | |||
t.pattern = "spec/live/**/*_spec.rb" | |||
t.pattern = "spec/live/**/view_spec.rb" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should change this back to *_spec.rb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can always run a specific test like rspec spec/live/view_spec.rb
2e0dbc1
to
e766759
Compare
write tests for #add_all_condition and #add_any_condition write tests for #all_conditions= and #any_conditions= write a test for #add_column update .gitignore
542369e
to
5c29921
Compare
3e48f62
to
22f44d6
Compare
37a6f74
to
a4b243a
Compare
a4b243a
to
0bb6c58
Compare
@steved555 @zendesk/archer |
@@ -473,20 +506,39 @@ class View < Rule | |||
has :execution, :class => RuleExecution | |||
has ViewCount, :path => "count" | |||
|
|||
def add_column(column) | |||
columns = execution.columns.map {|c| c[:id]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
columns = execution.columns.map(&:id)
is slightly shorter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 nice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hashie...
2e8c220
to
f8d0b5a
Compare
@steved555 |
@@ -20,4 +20,78 @@ def valid_attributes | |||
"all" => [{ "field" => "status", "operator" => "is", "value" => "pending" }] | |||
} | |||
it_should_be_deletable | |||
|
|||
subject do | |||
described_class.new(double, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you use valid_attributes for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, since live specs aren't run under travis it'd be really cool if we added a new spec/resources
or add these under spec/core
a04fa37
to
5ce06e0
Compare
5ce06e0
to
350d0f2
Compare
@steved555 |
👍 from me |
👍 Thanks for sticking with it |
Add helper methods for configuring Views
@steved555 @zendesk/archer
Write helper methods for View configuration, which includes assigning and updating "columns" and "conditions" arguments. Minitest for those methods are also written in view_spec.