Sha256: f94c2e459232a4d7dcb2a5ff91fb5937a31cab622271369d836564b42291ad2a

Contents?: true

Size: 701 Bytes

Versions: 7

Compression:

Stored size: 701 Bytes

Contents

class Card
  module SpecHelper
    module SaveHelper
      include Card::Model::SaveHelper
      def create! name, content=""
        Card.create! name: name, content: content
      end

      def create name_or_args, content_or_args=nil
        Card::Auth.as_bot { super }
      end

      def create_or_update name_or_args, content_or_args=nil
        Card::Auth.as_bot { super }
      end

      def update name_or_args, content_or_args={}
        Card::Auth.as_bot { super }
      end

      def update! name_or_args, content_or_args={}
        update_card name_or_args, content_or_args
      end

      def delete name
        Card::Auth.as_bot { Card[name].delete! }
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
card-1.93.3 spec/support/helper/save_helper.rb
card-1.93.2 spec/support/helper/save_helper.rb
card-1.93.1 spec/support/helper/save_helper.rb
card-1.93.0 spec/support/helper/save_helper.rb
card-1.92.2 spec/support/helper/save_helper.rb
card-1.92.1 spec/support/helper/save_helper.rb
card-1.92 spec/support/helper/save_helper.rb