From 17137f4f542e7877a6c9b505ae16eac5bfdb9558 Mon Sep 17 00:00:00 2001 From: Kevin Olbrich Date: Sat, 4 Jan 2014 02:58:47 +0000 Subject: [PATCH] tests for fields and joyent_module --- tests/joyent/models/analytics/field_tests.rb | 10 ++++++++++ tests/joyent/models/analytics/joyent_module_tests.rb | 10 ++++++++++ 2 files changed, 20 insertions(+) create mode 100644 tests/joyent/models/analytics/field_tests.rb create mode 100644 tests/joyent/models/analytics/joyent_module_tests.rb diff --git a/tests/joyent/models/analytics/field_tests.rb b/tests/joyent/models/analytics/field_tests.rb new file mode 100644 index 000000000..f16feb609 --- /dev/null +++ b/tests/joyent/models/analytics/field_tests.rb @@ -0,0 +1,10 @@ +Shindo.tests("Fog::Joyent[:analytics] | field", %w{joyent analytics}) do + @analytics = Fog::Joyent[:analytics] + @field = @analytics.fields.first + + tests('read only') do + returns(false, 'should not save') { @field.respond_to?(:save)} + returns(false, 'should not allow creating a new one') { @field.respond_to?(:create)} + returns(false, 'should not allow destroying') { @field.respond_to?(:destroy)} + end +end diff --git a/tests/joyent/models/analytics/joyent_module_tests.rb b/tests/joyent/models/analytics/joyent_module_tests.rb new file mode 100644 index 000000000..8fbe8c98a --- /dev/null +++ b/tests/joyent/models/analytics/joyent_module_tests.rb @@ -0,0 +1,10 @@ +Shindo.tests("Fog::Joyent[:analytics] | joyent_module", %w{joyent analytics}) do + @analytics = Fog::Joyent[:analytics] + @joyent_module = @analytics.joyent_modules.first + + tests('read only') do + returns(false, 'should not save') { @joyent_module.respond_to?(:save)} + returns(false, 'should not allow creating a new one') { @joyent_module.respond_to?(:create)} + returns(false, 'should not allow destroying') { @joyent_module.respond_to?(:destroy)} + end +end