diff --git a/vendor/plugins/rspec-on-rails-matchers/lib/rspec/rails/matchers/associations.rb b/spec/support/associations_matchers.rb similarity index 97% rename from vendor/plugins/rspec-on-rails-matchers/lib/rspec/rails/matchers/associations.rb rename to spec/support/associations_matchers.rb index 9424be22dd..4d2ca325db 100644 --- a/vendor/plugins/rspec-on-rails-matchers/lib/rspec/rails/matchers/associations.rb +++ b/spec/support/associations_matchers.rb @@ -1,5 +1,3 @@ -require 'rspec/expectations' - module RSpec module Rails module Matchers diff --git a/vendor/plugins/rspec-on-rails-matchers/lib/rspec/rails/matchers/validations.rb b/spec/support/validations_matchers.rb similarity index 98% rename from vendor/plugins/rspec-on-rails-matchers/lib/rspec/rails/matchers/validations.rb rename to spec/support/validations_matchers.rb index 3a9b20478e..cecfaf1eb5 100644 --- a/vendor/plugins/rspec-on-rails-matchers/lib/rspec/rails/matchers/validations.rb +++ b/spec/support/validations_matchers.rb @@ -1,5 +1,3 @@ -require 'rspec/expectations' - module RSpec module Rails module Matchers diff --git a/vendor/plugins/rspec-on-rails-matchers/CHANGELOG b/vendor/plugins/rspec-on-rails-matchers/CHANGELOG deleted file mode 100644 index 06959ce177..0000000000 --- a/vendor/plugins/rspec-on-rails-matchers/CHANGELOG +++ /dev/null @@ -1,10 +0,0 @@ -Change Log -========== - -Trunk ------ - -* 2008/03/02 - Added have_form_putting_to(url_or_path) - Patch by unknown google code submitter -* 2008/03/02 - Added should observe (Luke Melia) -* 2008/03/02 - Patched validates_length_of to use within to be consistent with Rails (Matt Pelletier) -* 2007/01/03 - Initial Public Release \ No newline at end of file diff --git a/vendor/plugins/rspec-on-rails-matchers/MIT-LICENSE b/vendor/plugins/rspec-on-rails-matchers/MIT-LICENSE deleted file mode 100644 index fc22016a72..0000000000 --- a/vendor/plugins/rspec-on-rails-matchers/MIT-LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2008 The Plugin Development Team - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/vendor/plugins/rspec-on-rails-matchers/README b/vendor/plugins/rspec-on-rails-matchers/README deleted file mode 100644 index 3bfb92392c..0000000000 --- a/vendor/plugins/rspec-on-rails-matchers/README +++ /dev/null @@ -1,187 +0,0 @@ -rspec-on-rails-matchers -======================= - -Setup ------- - -Dependencies: -------------- - - * rspec - * rspec_on_rails - -Overview --------- - -Adds the following RSpec matchers: - - * Associations: - Verify that the association has been defined. (doesn't verify that the association works!) - - object.should have_many(:association) - example: @post.should have_many(:comments) - TM snippet: [mshm + tab] (Model Should Have Many) - - object.should belong_to(:association) - example: @comment.should belong_to(:post) - TM snippet: [msbt + tab] - - object.should have_one(:association) - user.should have_one(:social_security_number) - TM snippet: [msho + tab] - - object.should have_and_belong_to_many(:association) - project.should have_and_belong_to_many(:categories) - TM snippet: [mshabtm + tab] - - - * Validations: - Verify that a validation has been defined. (doesn't test the validation itself) - - object.should validate_presence_of(:attribute) - TM snippet: [msvp + tab] - - object.should validate_confirmation_of(:attribute) - TM snippet: [msvc + tab] - - object.should validate_uniqueness_of(:attribute) - TM snippet: [msvu + tab] - - object.should validate_length_of(:attribute, :within => 5..10) - object.should validate_length_of(:attribute, :is => 5) - TM snippet: [msvl + tab] - - * Observers: - Verify that the observer is observing a class. (doesn't verify that the observation works) - - object.should observe(:model) - example: GroupObserver.should observe(Group) - - * Views: - Verifies that the views contains some tags. - - response.should have_form_posting_to(url_or_path) - TM snippet: [hfpt + tab] - - response.should have_form_putting_to(url_or_path) - - response.should have_text_field_for(:attribute) - TM snippet: [htff + tab] - - response.should have_label_for(:attribute) - TM snippet: [hlf + tab] - - response.should have_password_field_for(:attribute) - TM snippet: [hpff + tab] - - response.should have_checkbox_for(:attribute) - TM snippet: [hcf + tab] - - response.should have_submit_button - TM snippet: [hsb + tab] - - response.should have_link_to(url_or_path, "optional_text") - TM snippet: [hlt + tab] - - * nested view tests: - for instance: - - response.should have_form_posting_to(url_or_path) do - with_text_field_for(:attribute) - end - - with_text_field_for(:attribute) - TM snippet: [wtff + tab] - - with_label_for(:attribute) - TM snippet: [wlf + tab] - - with_password_field_for(:attribute) - TM snippet: [wpff + tab] - - with_checkbox_for(:attribute) - TM snippet: [wcf + tab] - - with_submit_button - TM snippet: [wsb + tab] - - with_link_to(url_or_path, "optional_text") - TM snippet: [wlt + tab] - -Usage: ------- - -In your view spec: - - it "should render new form" do - render "/users/new.html.erb" - - response.should have_form_posting_to(users_path) do - with_text_field_for(:user_name) - with_text_area_for(:user_address) - with_text_field_for(:user_login) - with_text_field_for(:user_email) - with_submit_button - end - end - -In your model spec: - - describe User do - before(:each) do - @user = User.new - end - - it "should have many posts" do - @user.should have_many(:posts) - end - - it "should belong to a group" do - @user.should belong_to(:group) - end - - it do - @user.should validate_presence_of(:email) - end - - it do - @user.should validate_uniqueness_of(:email) - end - - it do - @user.should validate_uniqueness_of(:login) - end - - it do - @user.should validate_presence_of(:login) - end - - it do - @user.should validate_presence_of(:name) - end - - it do - @user.should validate_length_of(:password, :between => 4..40) - end - - it do - @user.should validate_confirmation_of(:password) - end - - end - -Core Contributors ------------------ - - * Josh Knowles - * Bryan Helmkamp - * Matt Aimonetti - -Contributors -------------- - - * ckknight - * Matt Pelletier - * Luke Melia - -Copyright (c) 2008 The Plugin Development Team, released under the MIT license \ No newline at end of file diff --git a/vendor/plugins/rspec-on-rails-matchers/TODO b/vendor/plugins/rspec-on-rails-matchers/TODO deleted file mode 100644 index b2567b47ae..0000000000 --- a/vendor/plugins/rspec-on-rails-matchers/TODO +++ /dev/null @@ -1,4 +0,0 @@ -To Do -===== - -* Update README to include instructions on installing from github \ No newline at end of file diff --git a/vendor/plugins/rspec-on-rails-matchers/init.rb b/vendor/plugins/rspec-on-rails-matchers/init.rb deleted file mode 100644 index c02eafe659..0000000000 --- a/vendor/plugins/rspec-on-rails-matchers/init.rb +++ /dev/null @@ -1,6 +0,0 @@ -# We are only loading the modules we are using right now -# require 'spec/rails/matchers/observers' -require 'rspec/rails/matchers/associations' -require 'rspec/rails/matchers/validations' -# require 'spec/rails/matchers/views' -# require 'spec/rails/matchers/observers' diff --git a/vendor/plugins/rspec-on-rails-matchers/lib/rspec/rails/matchers/observers.rb b/vendor/plugins/rspec-on-rails-matchers/lib/rspec/rails/matchers/observers.rb deleted file mode 100644 index 30da6f3120..0000000000 --- a/vendor/plugins/rspec-on-rails-matchers/lib/rspec/rails/matchers/observers.rb +++ /dev/null @@ -1,34 +0,0 @@ -module RSpec - module Rails - module Matchers - - class Observe - def initialize(expected_model_class) - @expected_model_class = expected_model_class - end - - def matches?(observer) - @observer = observer - if @observer.is_a?(ActiveRecord::Observer) - @observer = @observer.class - end - @observed_classes = observer.observed_classes.flatten - @observed_classes.include?(@expected_model_class) - end - - def failure_message - return "expected #{@observer.name} to observe #{@expected_model_class.name}, but it was not included in [#{@observed_classes.map(&:name).join(', ')}]" - end - - def description - "observer to be observing #{@expected_model_class.name}" - end - end - - def observe(expected_model_class) - Observe.new(expected_model_class) - end - - end - end -end \ No newline at end of file diff --git a/vendor/plugins/rspec-on-rails-matchers/lib/rspec/rails/matchers/views.rb b/vendor/plugins/rspec-on-rails-matchers/lib/rspec/rails/matchers/views.rb deleted file mode 100644 index 7d9d2fc237..0000000000 --- a/vendor/plugins/rspec-on-rails-matchers/lib/rspec/rails/matchers/views.rb +++ /dev/null @@ -1,102 +0,0 @@ -module RSpec - module Rails - module Matchers - def have_form_posting_to(url_or_path) - return simple_matcher("have a form submitting via POST to '#{url_or_path}'") do |response| - have_tag("form[method=post][action=#{url_or_path}]").matches?(response) - end - end - - def have_form_puting_to(url_or_path, id) - return simple_matcher("have a form submitting via PUT to '#{url_or_path}/#{id}'") do |response| - have_tag("form[method=post][action=#{url_or_path}/#{id}]").matches?(response) - have_tag("input[name=_method][type=hidden][value=put]").matches?(response) - end - end - - def have_label_for(attribute, text) - return simple_matcher("have a label for '#{attribute}' with value of '#{text}'") do |response| - have_tag("label[for=#{attribute}]").matches?(response) - end - end - - def with_label_for(attribute, text) - return simple_matcher("have a label for '#{attribute}' with value of '#{text}'") do |response| - with_tag("label[for=#{attribute}]").matches?(response) - end - end - - def have_text_field_for(attribute) - return simple_matcher("have a text field for '#{attribute}'") do |response| - have_tag("input##{attribute}[type=text]").matches?(response) - end - end - - def with_text_field_for(attribute) - return simple_matcher("with a text field for '#{attribute}'") do |response| - with_tag("input##{attribute}[type=text]").matches?(response) - end - end - - def have_text_area_for(attribute) - return simple_matcher("have a text field for '#{attribute}'") do |response| - have_tag("textarea##{attribute}[type=text]").matches?(response) - end - end - - def with_text_area_for(attribute) - return simple_matcher("have a text field for '#{attribute}'") do |response| - with_tag("textarea##{attribute}[type=text]").matches?(response) - end - end - - def have_password_field_for(attribute) - return simple_matcher("have a password field for '#{attribute}'") do |response| - have_tag("input##{attribute}[type=password]").matches?(response) - end - end - - def with_password_field_for(attribute) - return simple_matcher("have a password field for '#{attribute}'") do |response| - with_tag("input##{attribute}[type=password]").matches?(response) - end - end - - def have_checkbox_for(attribute) - return simple_matcher("have a checkbox for '#{attribute}'") do |response| - have_tag("input##{attribute}[type=checkbox]").matches?(response) - end - end - - def with_checkbox_for(attribute) - return simple_matcher("have a checkbox for '#{attribute}'") do |response| - with_tag("input##{attribute}[type=checkbox]").matches?(response) - end - end - - def have_submit_button - return simple_matcher("have a submit button") do |response| - have_tag("input[type=submit]").matches?(response) - end - end - - def with_submit_button - return simple_matcher("have a submit button") do |response| - with_tag("input[type=submit]").matches?(response) - end - end - - def have_link_to(url_or_path, text = nil) - return simple_matcher("have a link to '#{url_or_path}'") do |response| - have_tag("a[href=#{url_or_path}]", text).matches?(response) - end - end - - def with_link_to(url_or_path, text = nil) - return simple_matcher("have a link to '#{url_or_path}'") do |response| - with_tag("a[href=#{url_or_path}]", text).matches?(response) - end - end - end - end -end \ No newline at end of file