Class: ScraperWiki::API::Matchers::UserRolesMatcher
Instance Method Summary
collapse
Instance Method Details
#failure_message ⇒ Object
128
129
130
|
# File 'lib/scraperwiki-api/matchers.rb', line 128
def failure_message
"expected #{@actual['short_name']} to be editable by #{@expected}"
end
|
#matches?(actual) ⇒ Boolean
121
122
123
124
125
126
|
# File 'lib/scraperwiki-api/matchers.rb', line 121
def matches?(actual)
super
%w(owner editor).any? do |userrole|
actual['userroles'][userrole].include? @expected
end
end
|
#negative_failure_message ⇒ Object
132
133
134
|
# File 'lib/scraperwiki-api/matchers.rb', line 132
def negative_failure_message
"expected #{@actual['short_name']} to not be editable by #{@expected}"
end
|