Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.77 KB | None | 0 0
  1. jasmine (1.2.1)
  2. jasmine-core (>= 1.2.0)
  3. rack (~> 1.0)
  4. rspec (>= 1.3.1)
  5. selenium-webdriver (>= 0.1.3)
  6. jasmine-core (1.2.0)
  7. jasmine-headless-webkit (0.8.4)
  8. coffee-script
  9. jasmine-core (~> 1.1)
  10. multi_json
  11. rainbow
  12. sprockets (~> 2)
  13. jasmine-rails (0.1.0)
  14. jasmine
  15. jasmine-headless-webkit
  16. rails (>= 3.1.0)
  17.  
  18. describe ("my basic jasmine jquery test", function(){
  19.  
  20. beforeEach(function(){
  21. $('body').append('<a id="test_link" href="somewhere.html">My test link</a>');
  22. });
  23.  
  24. afterEach(function(){
  25. $('a#test_link').remove();
  26. });
  27.  
  28. it ("does some basic jQuery thing", function () {
  29. $('a#test_link').click();
  30. expect($("a#test_link")).toHaveText('My test link is now longer');
  31. });
  32.  
  33. it ("does some the same basic jQuery thing with a different trigger type", function () {
  34. $('a#test_link').trigger('click');
  35. expect($("a#test_link")).toHaveText('My test link is now longer');
  36. });
  37.  
  38. });
  39.  
  40. describe ('subtraction', function(){
  41.  
  42. var a = 1;
  43. var b = 2;
  44.  
  45. it("returns the correct answer", function(){
  46. expect(subtraction(a,b)).toBe(-1);
  47. });
  48.  
  49. });
  50.  
  51. function subtraction(a,b){
  52. return a - b;
  53. }
  54.  
  55. jQuery (function($) {
  56.  
  57. $("a#test_link").click(changeTheTextOfTheLink)
  58. function changeTheTextOfTheLink(e) {
  59. e.preventDefault()
  60. $("a#test_link").append(' is now longer');
  61. }
  62.  
  63. });
  64.  
  65. FF.
  66. FAIL: 3 tests, 2 failures, 0.013 secs.
  67.  
  68. my basic jasmine jquery test does some basic jQuery thing. (/Users/rebekah/OPSWAT/opswat_cwm/spec/javascripts/UserInvitationsSpec.js:11)
  69. Expected '<a id="test_link" href="somewhere.html">My test link</a>' to have text 'My test link is now longer'. (line ~13)
  70. expect($("a#test_link")).toHaveText('My test link is now longer');
  71.  
  72. my basic jasmine jquery test does some the same basic jQuery thing with a different trigger type. (/Users/rebekah/OPSWAT/opswat_cwm/spec/javascripts/UserInvitationsSpec.js:16)
  73. Expected '<a id="test_link" href="somewhere.html">My test link</a>' to have text 'My test link is now longer'. (line ~18)
  74. expect($("a#test_link")).toHaveText('My test link is now longer');
  75.  
  76. //= require jquery
  77. //= require jquery_ujs
  78. //= require bootstrap
  79. //= require vendor
  80. //= require_tree .
  81.  
  82. src_files:
  83. - "application.{js,coffee}"
  84.  
  85. stylesheets:
  86.  
  87. helpers:
  88. - "helpers/**/*.{js,coffee}"
  89.  
  90. spec_files:
  91. - "**/*[Ss]pec.{js,coffee}"
  92.  
  93. src_dir: "app/assets/javascripts"
  94.  
  95. spec_dir: spec/javascripts
  96.  
  97. asset_paths:
  98. - "vendor/assets/javascripts"
  99.  
  100. // application.js
  101.  
  102. jQuery(function ($) {
  103. console.log("In document.ready");
  104. });
  105.  
  106. // test_spec.js
  107.  
  108. describe("the order of things", function () {
  109. beforeEach(function () {
  110. console.log("In beforeEach");
  111. });
  112.  
  113. it("should run some tests", function () {
  114. console.log("In test");
  115. });
  116. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement